About 5,170,000 results
Open links in new tab
  1. C strcmp() - GeeksforGeeks

    Apr 2, 2025 · In C, strcmp() is a built-in library function used to compare two strings lexicographically. It takes two strings (array of characters) as arguments, compares these two …

  2. How do I properly compare strings in C? - Stack Overflow

    Next, to compare strings, you must use strcmp, where a return value of 0 indicates that the two strings match. Using the equality operators (ie. !=) compares the address of the two strings, as …

  3. How to Check if Two Strings Are Equal in C - Examples - Tutorial …

    In C, we can compare two strings to check if they are equal using functions like strcmp() from the string.h library or by manually comparing each character using a loop. In this tutorial, we will …

  4. C Program to Check Whether Two String are Equal - QnA Plus

    Aug 22, 2020 · Here we’ll see how to check whether two strings are equal. C string (string.h) library already provides a function to do that. Using strcmp() Take two strings as input (say, s1 …

  5. c - How to compare strings in an "if" statement? - Stack Overflow

    Nov 22, 2011 · The standard library's strcmp function compares two strings, and returns 0 if they are identical, or a negative number if the first string is alphabetically "less than" the second …

  6. Comparing two strings in C? - Stack Overflow

    To compare two C strings (char *), use strcmp(). The function returns 0 when the strings are equal, so you would need to use this in your code: if (strcmp(namet2, nameIt2) != 0) If you …

  7. Compare Two Strings in C with Examples - Sanfoundry

    Here is a program that compare two strings in C using loops, strcmp function (inbuilt function) and pointers along with detailed explanations and examples.

  8. How to Compare Two Strings in C - Tutorial Kart

    Compare Two Strings in C. In C, we can compare two strings using the strcmp() function from the string.h library or by manually comparing characters using loops. These methods help …

  9. C strcmp() - C Standard Library - Programiz

    In this tutorial, you will learn to compare two strings using the strcmp () function.

  10. C Program to Compare Two Strings Using strcmp - W3Schools

    This C program is used to compare two strings by using strcmp () function. strcmp () function compares two strings lexicographically, and it's declared in stdio.h. Case 1: when the strings …

  11. Some results have been removed
Refresh