如题所述
举例来说:FILE*fp=fopen("dict.txt","r");charbuf[1024];if(fp!=(FILE*)NULL){while(fgets(buf,sizeof(buf),fp))//从文件中读入一行字符串,保存在buf中,直到读完所有字符串{//处理读入的字符串buf}fclose(fp);}
温馨提示:答案为网友推荐,仅供参考
第1个回答 2016-11-06
DIR *df = opendir(char *dir_name);
int Is_empty = 0;
struct dirent *dp;
if ((dp = readdir(df)) == NULL)
return Is_empty=1;本回答被网友采纳
int Is_empty = 0;
struct dirent *dp;
if ((dp = readdir(df)) == NULL)
return Is_empty=1;本回答被网友采纳