#include<iostream.h>
#include<stdio.h>
#include<conio.h>
void main()
{
FILE *fp;
clrscr();
fp=fopen("ab","w+");
char ch;
while((ch=getchar())!=EOF)
{
putc(ch,fp);
}
cout<<"the entered list is \n";
fflush(fp);
fseek(fp,0L,0);
while((ch=getc(fp))!=EOF)
{
cout<<ch;
}
fclose(fp);
getch();
}
OUTPUT:
very good to get more knowledge about c++ concepts.keep it up
ReplyDelete