Answers for "how to check a string and set a variable based on the string in c"

C
4

check if string in string c

if(strstr(sent, word) != NULL) {
    /* ... */
}
Posted by: Guest on February-23-2020
0

correct way to check a string is uninitialised in c

char x[16] = { 0 }; // note the use of the initializer, it sets the first character to 0, which is all we need to test for initialization.

if (x[0] == 0)
  // x is uninitialized.
else
  // x has been initialized
Posted by: Guest on February-27-2020

Code answers related to "how to check a string and set a variable based on the string in c"

Code answers related to "C"

Browse Popular Code Answers by Language