Please tell me if this code is correct for searching a string in PTIN with contents in PTOUT. I am not getting the correct result. Please help.
Code:while(fgets(text, MAX_LEN_SINGLE_LINE, ptin)!=NULL)
{
if(text[strlen(text)-1]=='\n')
text[strlen(text)-1]='\0';
while(fgets(textchk, MAX_LEN_SINGLE_LINE, ptout)!=NULL)
{
a=strstr(textchk,text);
if(a==NULL)
fprintf(p1,"%s",text);
else
continue;
}rewind(ptout);
}