Hello im trying to make a program to find names inside char array, but i get 4 errors:
error: cannot convert 'char (*)[9]' to 'char (*)[]' in assignment (line 20)
error: cannot convert 'char (*)[8]' to 'char (*)[]' in assignment (line 21)
error: cannot convert 'char (*)[8]' to 'char (*)[]' in assignment (line 22)
error: invalid use of array with unspecified bounds (line 24)
repeated searching for same string multiple times?
char * c = yourstring;
do
{
c = strstr(c, "something");
if(c)
{count++; c++;} //count++ can be replaced with whatever when you found a match logic.
//c++ can be replaced with c+= strlen if you don't want nested matches.
}
while(c);