#include<iostream.h> #include<conio.h> #include<fstream.h> #include<stdio.h> void main() { clrscr(); char ch,st[100],cha,ts[100]; ofstream o("r.txt"); cout<<"\n Enter the contents of file1:"; do { ch=cin.get(); fflush(stdin); o.put(ch); } while(ch!='.'); o.close(); ofstream t("u.txt"); cout<<"\n Enter the contents fo file2:"; do { cha=cin.get(); fflush(stdin); t.put(cha); } while(cha!='.'); t.close(); ifstream i,j; i.open("r.txt"); j.open("u.txt"); fstream k; k.open("m.txt",ios::app); while(!i.eof()) { fflush(stdin); i.read((char*)&st,sizeof(st)); fflush(stdin); k.clear(); k.write((char*)&st,sizeof(st)); cout<<st; } while(!j.eof()) { fflush(stdin); j.read((char*)&ts,sizeof(ts)); fflush(stdin); k.clear(); k.write((char*)&ts,sizeof(ts)); cout<<ts; } getch(); }