C Programming Language

strcmp()

Syntax:
#include<string.h>
int strcmp( char *str1, char *str2 );

                   strcmp(str1,str2) compares str1 and str2 lexicographically .Returns a negative value if str1<str2; 0 if str1 and str2 are identical; and positive value if str1>str2.

Example -1:

strcmp() function 1  

Example-2:

strcmp() function 2

Example-3:

strcmp() function 3
strncpy() Home strcmpi()

c program stats