char* func( char* a, const char* b )
{
while( *a )
{
char *s = a, *t = b;
while( (*s++ == *t++) && *s && *t );
if( *t == 0 )
return a;
a++;
}
return 0;
}
The above code was written to search for the first instance of string "b" inside of string "a."
Is there any problem with the above program?
Is there any approach to improve the efficiency of it?