Text mode Output using put() function & Input get() function.
CODING:
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
void main()
{
clrscr();
//using put() function
cout.put('K');
ofstream ofile("c++.txt");
ofile.put('K');
char c;
//using get() function
ifstream fin("c++.txt");
fin.get(c);
cout<<c;
getch();
}
CODING:
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
void main()
{
clrscr();
//using put() function
cout.put('K');
ofstream ofile("c++.txt");
ofile.put('K');
char c;
//using get() function
ifstream fin("c++.txt");
fin.get(c);
cout<<c;
getch();
}
Comments
Post a Comment