#include<stdio.h>
main()
{
FILE *p,*q;
char b;
int a;
p = fopen("three", "w");
for(a=1; a<=50; a++)
fprintf(p, "%c", a);
fclose(p);
q = fopen("three", "r");
while(!feof(q))
{
fscanf(q, "%c", &b); //dont print after 25! ?
printf("%d",b);
}
fclose(q);
}
The question is why it does not print after 25. I tried by removing feof
also but it showed that only 25th char is read to file.
I guess this line is creating some problem!
fprintf(p,"%c",26);
but have no idea why!