I want to make a program that delete a String that the same as user input from a file below are contents in the file
G12
G13
G14
For example user input G13 , expected output is as following :
G12
G14
I got some idea that make a temporary file , but don't get any idea on how to get a string line by line because i print the file content using these code
if(file!=NULL)
{
while ((c = getc(file)) != EOF)
putchar(c);
fclose(file);
}
so basically i reads all the file content only letter by letter (dont have any idea how to make it reads word by word
Thanks in advance
fgetsfor reading ine line.fscanfandsscanfmay also be useful.