C++ Program for READING CONTENT FROM THE FILE. #include<iostream.h> #include<fstream.h> #include<conio.h> void main() { clrscr(); char c[25]; ifstream ifs("h:\\first1.txt"); cout<<"\n\n\t\tFILE CONTENT\n\n"; while(!ifs.eof()) { cout<<"\nPosition : "<<ifs.tellg(); ifs.getline(c,20);//READING FROM THE FILE cout<<"\nPosition : "<<ifs.tellg()<<"\tcontent : "; cout<<c<<endl; } getch(); } |
---|
Today Program in C++:
Posted by
Unknown
|
Friday, November 25
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment