docs(file): fixed #51

This commit is contained in:
ruanyf
2021-10-24 07:47:07 +08:00
parent ef8b5d6c78
commit b9f68b17b4

View File

@@ -21,12 +21,19 @@ FILE* fp;
int main(void) {
FILE* fp;
fp = fopen("hello.txt", "r");
char c;
char c = fgetc(fp);
fp = fopen("hello.txt", "r");
if (fp == NULL) {
return -1;
}
c = fgetc(fp);
printf("%c\n", c);
fclose(fp);
return 0;
}
```