㈠ c语言中如何从文件里读取一段字符串,至换行符
fgets读取一行来,自fgetc读取一个字符,fread读取你想要的长度FILE *fp = fopen(fileName,"r");if (fp != NULL){ char buf[1024] = {0}; fgets(buf,fp);}fclose(fp);
㈠ c语言中如何从文件里读取一段字符串,至换行符
fgets读取一行来,自fgetc读取一个字符,fread读取你想要的长度FILE *fp = fopen(fileName,"r");if (fp != NULL){ char buf[1024] = {0}; fgets(buf,fp);}fclose(fp);