Basic Member
|
#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);
}
|