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.
More Related Contents:
- read specific number of chars in c [closed]
- I had issue in below mention program to assign a value to the pointer.String concatenation Program( *s1=*s2) [closed]
- How can I get a text file into a string but whith the “\n” in C?
- pointer to string concept in c [closed]
- String manipulation in C (replace & insert characters)
- returning string in C function [closed]
- When should I use ampersand with scanf()
- How do I concatenate two strings in C?
- How does concatenation of two string literals work?
- Are string literals const?
- Check substring exists in a string in C
- How to dynamically allocate memory space for a string and get that string from user?
- How do you convert a byte array to a hexadecimal string in C?
- How to read string from keyboard using C?
- Looking for a good hash table implementation in C [closed]
- Tokenizing strings in C
- Why doesn’t scanf need an ampersand for strings and also works fine in printf (in C)?
- How do I print a non-null-terminated string using printf?
- What is the proper way of implementing a good “itoa()” function?
- string array with garbage character at end
- What is a “wide character string” in C language?
- Array type char[] is not assignable [duplicate]
- Conversion of Char to Binary in C
- Modify a string with pointer [duplicate]
- C’s strtok() and read only string literals
- realloc(): invalid next size when reallocating to make space for strcat on char * [duplicate]
- Creating C formatted strings (not printing them)
- C split a char array into different variables
- A possible algorithm for determining whether two strings are anagrams of one another? [closed]
- Counting words in a string – c programming