//program stores characters until escape key is not pressed
#include<iostream.h>
#include<fstream.h>
#include<conio.h>
void main()
{
char ch;
ofstream as("test.txt");
clrscr();
while(ch!=27)
{
ch = getche();
//obj.put(character);
as.put(ch);
if(ch=='\r')
cout<<endl;
}
}
//read character by character data from the file :D
//umarjaved01@gmail.com
#include<iostream.h>
#include<fstream.h>
#include<conio.h>
void main()
{
char ch;
ifstream as("test.txt");
clrscr();
while(as)
{
as.get(ch);
cout<<ch;
}
}
#include<iostream.h>
#include<fstream.h>
#include<conio.h>
void main()
{
char ch;
ofstream as("test.txt");
clrscr();
while(ch!=27)
{
ch = getche();
//obj.put(character);
as.put(ch);
if(ch=='\r')
cout<<endl;
}
}
//read character by character data from the file :D
//umarjaved01@gmail.com
#include<iostream.h>
#include<fstream.h>
#include<conio.h>
void main()
{
char ch;
ifstream as("test.txt");
clrscr();
while(as)
{
as.get(ch);
cout<<ch;
}
}