String Compare in C
Arrays and Strings in Tamil
String Compare in C
- The strcmp() function takes two strings and return an integer.
- The strcmp() compares two strings character by character.
- If the first character of two strings are equal, next character of two strings are compared.
- This continues until the corresponding characters of two strings are different or a null character '\0' is reached.
- It is defined in string.h header file.
Sample Code
Learn C - C tutorial - String Compare - C examples - C programs
Output
Read Also
Compare Two Strings in JavaString Compare Without Using Strcmp()
Sample Code
Learn C - C tutorial - String Compare Without Using Strcmp - C examples - C programs