Note: (Restricted functionality due to obvious reasons!)
Minimal Code ( Raw-View ) :
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
void main()
{
fstream fl; // creating object of "fstream"
char c='d';
fl.open("sss.txt",'w'); // open file to write
while(c != 13){
c=getch();
fl<<c; // write a character to FILE
cout<<c; // print character on SCREEN
}
cout<<endl;
fl.close(); // close file-handle
getch();
}