if (strstr(sent, word) != NULL) {
/* ... */
}
Note that strstr
returns a pointer to the start of the word in sent
if the word word
is found.
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?
- String compare function in C [closed]
- Removing trailing newline character from fgets() input
- How do you allow spaces to be entered using scanf?
- How to convert an int to string in C?
- What function is to replace a substring from a string in C?
- Stringification of a macro value
- How does concatenation of two string literals work?
- Why is “a” != “a” in C?
- Is the strrev() function not available in Linux?
- 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?
- 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