Text mode Input using EXTRACTION ">>" Operator.
CODING:
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
void main()
{
int i;
char c;
double d;
clrscr();
ifstream fin("ex.txt");
fin>>c;
fin>>d;
fin>>i;
for(int t=0;t<8;t++)
cout<<c[t];
cout<<endl<<d;
cout<<endl<<i;
getch();
}
CODING:
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
void main()
{
int i;
char c;
double d;
clrscr();
ifstream fin("ex.txt");
fin>>c;
fin>>d;
fin>>i;
for(int t=0;t<8;t++)
cout<<c[t];
cout<<endl<<d;
cout<<endl<<i;
getch();
}
Comments
Post a Comment