String compare function in C [closed]

To answer your question,

strcmp("zail", "nail")

is evaluating to 12 because it’s subtracting the ‘n’ in “nail” from the ‘z’ in “zail”, and ‘z’ – ‘n’ = 12.

Leave a Comment