//read data from the file
//using object of ifstream class
#include<fstream.h>
#include<conio.h>
void main()
{
clrscr();
char *n;
ifstream in("text");//opens a file in read mode
in>>n; //reads string from file
cout<<n<<" "; //display string to the console
in>>n;
cout<<n<<" ";
in>>n;
cout<<n<<" ";
in>>n;
cout<<n<<" ";
in>>n;
cout<<n<<" ";
in>>n;
cout<<n<<" ";
in>>n;
cout<<n<<" ";
getch();
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.