0

why strcmp(name,"name")==0 gives true in C when both the strings are same?

Strings in C

13th Jun 2020, 2:59 AM
Lind L Tyler
Lind L Tyler - avatar
2 RĂ©ponses
+ 5
That's exactly how strcmp() works. It returns 0 if the strings are the same, else returns non-zero value. https://www.tutorialspoint.com/c_standard_library/c_function_strcmp.htm
13th Jun 2020, 3:04 AM
äœ çŸ„é“èŠć‰‡ïŒŒæˆ‘äčŸæ˜Ż
äœ çŸ„é“èŠć‰‡ïŒŒæˆ‘äčŸæ˜Ż - avatar
0
Thank you Carrie I thought it was just like boolean values . Well Thank you very much.
13th Jun 2020, 3:06 AM
Lind L Tyler
Lind L Tyler - avatar