While comparing two identical strings using strcmp() function, the returned value is: a.-1 b.1 c.0 d.true??
Answers
Answered by
3
Answer:
If two strings are same then strcmp() returns 0 , otherwise, it returns a non-zero value. This function compares strings character by character using ASCII value of the characters. The comparison stops when either end of the string is reached or corresponding characters are not same.
Explanation:
Bro please foll!ow me...
Answered by
0
While comparing two identical strings using strcmp() function, the returned value:
Explanation:
- C comparison functions like int strcmp(char* a, char* b); return zero when the values are equal. A comparison function measures greater than and less than as well as equality.
- Comparison Function Return Values
- a<b less than returns (-1)
- a==b equality returns zero
- a>b greater than returns +1
- So, c.0 is correct.
Similar questions
Geography,
1 month ago
Math,
1 month ago
Social Sciences,
3 months ago
Math,
10 months ago
English,
10 months ago