#include<stdio.h>
#include<conio.h>
void main()
{
char i,c;
FILE *p;
clrscr();
p=fopen("test.txt","w");
while((c=getchar())!=EOF)
{
putc(c,p);
}
fclose(p);
p=fopen("test.txt","r");
while((c=getc(p))!=EOF)
{
printf("%c",c);
}
fclose(p);
getch();
}
#include<conio.h>
void main()
{
char i,c;
FILE *p;
clrscr();
p=fopen("test.txt","w");
while((c=getchar())!=EOF)
{
putc(c,p);
}
fclose(p);
p=fopen("test.txt","r");
while((c=getc(p))!=EOF)
{
printf("%c",c);
}
fclose(p);
getch();
}
No comments:
Post a Comment