I have a do loop that prints out a given text file line by line.
It works great, but I want the program to not print an entire line if said line starts with a specific character (in this case, #
).
do
{
c = fgetc(file);
if (c != compare[0]) //char * compare= "#"
{
printf("%c",c);
}
} while (c != EOF);
fclose(file);
return 0;
This code above just prints everything and skips only the #
character itself.