I have edited the program like this
#include<stdio. h>
void main()
{
FILE *f;
char c,p;
clrscr();
printf("Data Input:\n");
f=fopen("INPUT" ,"w");
p=EOF;
while((c=getcha r())!=EOF)
putc(c,f);
fclose(f);
printf("Data Output:\n");
f=fopen("INPUT" ,"r");
while((c=getc(f ))!=EOF)
printf("%c",c);
fclose(f);
}
But I am not able to find out the which indicates the end of the file while i am reading the charectors from the keyboard...? i have tried the cntrl+z... but of no use... please let me know... other indication of the EOF.... of the file of my system windows...... sir?
#include<stdio. h>
void main()
{
FILE *f;
char c,p;
clrscr();
printf("Data Input:\n");
f=fopen("INPUT" ,"w");
p=EOF;
while((c=getcha r())!=EOF)
putc(c,f);
fclose(f);
printf("Data Output:\n");
f=fopen("INPUT" ,"r");
while((c=getc(f ))!=EOF)
printf("%c",c);
fclose(f);
}
But I am not able to find out the which indicates the end of the file while i am reading the charectors from the keyboard...? i have tried the cntrl+z... but of no use... please let me know... other indication of the EOF.... of the file of my system windows...... sir?
Comment