|
|
发表于 2005-9-10 10:39:18
|
显示全部楼层
FIEL *fp;
char buf[1024];
if(NULL == (fp = fopen(yourfile,"r"))){
perror("can not open file");
return -1;
}
while(fgets(buf,sizeof(buf),fp)){
/*every line's contents are stored in buf
your code here
..........................
*/
} |
|