I want to find if a particular line in File1(ptin) exists in File2(ptout).
If it aint existing then printf the line File1. I think the code is correct but I am getting blank lines. Please help me with the code.
Code:
ptin=fopen("check1.txt","r");
ptout=fopen(outfile,"r");
if(ptin!=NULL&&ptout!=NULL)
{
while(fgets(text, MAX_LEN_SINGLE_LINE, ptin)!=NULL)
{
while(fgets(textchk, MAX_LEN_SINGLE_LINE, ptout)!=NULL)
{
char *a=strstr(text,textchk);
if(a!=NULL)
puts(text);
else
continue;
}//rewind(ptout);
}
}
else
printf("File not found :(\n");