This repository has been archived on 2025-12-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2024-09-20 14:17:13 +03:00

15 lines
333 B
C

#include <stdio.h>
int main(void) {
char line[50];
FILE *fptr;
fptr = fopen("text_file.txt", "r"); // Open an existing file
printf("Here is the content of the file:\n");
/* Print all rows of the file */
while (fgets(line, 50, fptr) != NULL) {
printf("%s", line);
}
fclose(fptr);
return(0);
}