It works now, perfectly.
Full code:
int main()
{
char *p="parparpar";
int total=0;
while ( (p=strstr(p,"par")) != NULL )
Type: Posts; User: hypper
It works now, perfectly.
Full code:
int main()
{
char *p="parparpar";
int total=0;
while ( (p=strstr(p,"par")) != NULL )
Salem thanks but its not working, I tried your code but its not returning what it should.
For the code below, it returns 4 instead of 2.
Thanks for your help, waiting for more answers if...
Hello guys.
Im having troubles with the "strstr" function.
Im trying to count the number of times a substring appears in a string.
For this im using the STRSTR function but that function returns...