#include<cstdio> #include<stdlib.h> #include<iostream> int main() { char s[] = "asdfasdf"; FILE *d = fopen("a.txt", "r"); if (d == NULL){ printf("no\n"); exit(0); } char *m;//改成m[10]才可以,原来的写法为什么不对? fgets(m,5, d); printf("%s\n", m); fclose(d); }
onemoo
Xyino_Snake
慕的地8582982