c
C / C++ / MFC
5
Posts
5
Posters
0
Views
1
Watching
-
why the function strstr used in C ?
-
why the function strstr used in C ?
-
why the function strstr used in C ?
why? Simply to search for a string in another string.
Watched code never compiles.
-
why the function strstr used in C ?
strstr()
finds a substring in a string. use it to search inside string elements.#include
#includemain()
{
char mainString[]="string to search";
char strstr_sub_string_to_search[]="to";if ( strstr(mainString, strstr_sub_string_to_search)) puts("strstr() found Substring in main string\n");
else puts("strstr() did not find Substring in main string\n");return 0;
} -
why the function strstr used in C ?
http://www.cplusplus.com/reference/clibrary/cstring/strstr/[^] Find a string within a string...