How to check whether two strings are equal in C language

h‮‬ttps://www.lautturi.com
How to check whether two strings are equal in C language
/*
Example:check whether two strings are equal or not in C language
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
    char string1[] = {"hello lautturi"};
    char string2[] = {"hello lautturi"};

    if (strcmp(string1, string2) == 0)
        printf("strings are same\n");
    else
        printf("strings are not same\n" );
    return 0;
}
Created Time:2017-08-28 14:41:23  Author:lautturi