瀏覽單個文章
crazyjack
Basic Member
 
crazyjack的大頭照
 

加入日期: Aug 2003
您的住址: 洛杉磯
文章: 19
#include <stdlib.h>
#include <stdio.h>

void main()
{
FILE *fp;
char getstring[100];
char filename[128]="a.txt";
int count = 0;

if((fp = fopen(filename, "r")) !=NULL)
{
printf("OPEN DOEN!\n");
}

while(!feof(fp)) //check if it is END OF FILE
getstring[count++] = getc(fp);

printf("%s",getstring);

fclose(fp);
}
舊 2004-05-05, 03:37 AM #8
回應時引用此文章
crazyjack離線中