Find string in a string true/false strcspn no good
I was trying to read a file and find words in it (scripting engine) and can''t figure out how to find out whether a word is in the string i''ve read with fgets. Pleas help..
" Do we need us? "
strcspn() is for something else entirely
You need strstr(). It returns a pointer to wherever it found the substring in the main string, or NULL if it isn''t there.
You need strstr(). It returns a pointer to wherever it found the substring in the main string, or NULL if it isn''t there.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement