Could someone tell me why this aint working? I understand this could be done using strstr() function. I just gave it a try and I cant quite figure out why this piece of code
returns NULL though the search string is present in the main string.
Please let me know.
char * strpos(char *, char *);
char s = "I love my job";
char t = "job";
char *pos = strpos(s, t);
char * strpos(char *a, char *b)
for(; *a; a++ )
for(pa = a, pb = b; *pb && (*pa == *pb); pa++, pb++ )
if(*pb == '\0')