i am trying to print a line from a text file then go to the next line and print that until there is no more lines left to print. This is what i have so far, but it only works the first time that i run the program.
void ReadFile(FILE *a)
{
char line[23];
while(fgets(line, 22, a) != NULL)
{
printf("%s", line);
}
}
You will need to reset the file pointer back to the start if you want to do this multiple times with the same
FILEobject:Reference.