C - File Handling - Read from a file line by line
C - File Handling - Read from a file line by line
CODE
#include <stdio.h>
int main()
{
char line[500];
FILE* filePTR = fopen("data.txt", "r");
while (fgets(line, sizeof(line), filePTR)) {
printf("%s", line);
}
fclose(filePTR);
return 0;
}
Comments
Post a Comment