c - strcmp isn't comparing strings properly -


this question has answer here:

so have (not full code)

char list[1000][10];

strcpy(list[0],"ab");

printf("%d\n",strcmp(list[0],"ab"));

and strcmp returning 0. can explain why it's doing so?

thanks in advance.

the strcmp method return 0 if list[0] contains "ab" in case.

it returns:

returns integral value indicating relationship between strings:

a 0 value indicates both strings equal.

a value greater 0 indicates first character not match has greater value in str1 in str2; , value less 0 indicates opposite.


Comments

Popular posts from this blog

Line ending issue with Mercurial or Visual Studio -

tags - Jquery Mixitup plugin help prevent handlers being destroyed -

c# - Delving into the world of XML (Windows Phone) Error I dont understand (The ' ' character, hexadecimal value 0x20, cannot be included in a name.) -