C语言从文件读取文本
FILE *f; f = fopen ("path/to/file.ext", "r"); while (!feof (f)) { c = fgetc (f); buff[i++] = c; } fclose (f); buff[i-1] = '\0'; printf ("%s\n", buff);
C语言从文件读取文本
FILE *f; f = fopen ("path/to/file.ext", "r"); while (!feof (f)) { c = fgetc (f); buff[i++] = c; } fclose (f); buff[i-1] = '\0'; printf ("%s\n", buff);