Aug 29, 2012 at 3:29pm UTC
Your function is invalid. For example consider the following statement
if ( !*str2 )
return((char *)str1);
Why are you returning the first string when the second string is empty? I think you shall return NULL.
Last edited on Aug 29, 2012 at 3:30pm UTC
Aug 29, 2012 at 3:34pm UTC
@vlad
changed.
if ( !*str2 )
return(NULL);
but the output still same,
STRING NOT FOUND
Aug 29, 2012 at 4:11pm UTC
It's work ! Thanks you !
By the way , can explain why the for loop
the first condition u just blank it?
Aug 29, 2012 at 4:13pm UTC
Because the first part is normally the initialisation of the counting variable.
In this case however, a pointer to str2 is the counter and it is already defined, so there's no need to define another counter variable.
Hope that makes sense.
All the best,
NwN
Aug 30, 2012 at 12:28am UTC
okay thanks u
@nwn , thanks ya