I got debug for case s Especially I dont know how to researc
I got debug for case \'s\', Especially, I don\'t know how to research and compare in my txt.files.
And If there\'s another debug, plz correct it.
includeSolution
Replace the case s: with
case \'s\':
{
myfile = fopen(\"story.txt\",\"r\"); // text file
printf(\"Enter word to search: \");
scanf(\"%s\",name);
while(fgets(line,1024,myfile)!=NULL) // reads untill the end of file
{
if(strstr(line,name) != NULL) // strstr finds the name in line
{
printf(\"Found %s\",name);
getch();
break;
}
}
}
Thank you
