mirror of
https://github.com/ChenKaiLiuG/find_your_own_fxxking_problem.git
synced 2026-06-17 16:54:24 +00:00
Create print.c
This commit is contained in:
23
print.c
Normal file
23
print.c
Normal file
@@ -0,0 +1,23 @@
|
||||
// Under debugging
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int main() {
|
||||
FILE *file;
|
||||
char filename[] = "找找自己問題.txt";
|
||||
char line[256];
|
||||
file = fopen(filename, "r");
|
||||
|
||||
if (file == NULL) {
|
||||
perror("無法開啟檔案");
|
||||
return 1;
|
||||
}
|
||||
|
||||
while (fgets(line, sizeof(line), file) != NULL) {
|
||||
printf("%s", line);
|
||||
}
|
||||
|
||||
fclose(file);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user