C++ program to perform operations on a text file

#include<fstream.h> 
#include<conio.h>
#include<stdlib.h>

class text_file
{
	char ch;
	char fname[11];
	char fname1[11];
	ifstream ifile;
	ofstream ofile;
public:
	void write()
	{
		cout<<"\nEnter file name(to be created):";
		cin>>ch;
		ofile.open(fname);
		if(!ofile)
		{
			cout<<"\n\n ERROR!!";
			exit(1);
		} 
		cout<<"\nEnter data.....\n(press ESc. to exit editor)";
		while(ch!=(char)27)
		{
			ofile.put(ch);
		}
		ofile.close();
	}
	void read()
	{
		cout<<"\nEnter file name(to be read):";
		cin>>fname;
		ifile.open(fname);
		if(!ifile)
		{
			cout<<"\n\n ERROR!!";
			exit(1);
		} 
		cout<<"\nData is displayed now...";
		while(ifile)
		{
			ifile.get(ch);
			cout<<ch;
		}
		ifile.close();
	}
	void copy()
	{
		cout<<"\nEnter file name(source):";
		cin>>fname;
		ifile.open(fname);
		if(!ifile)
		{
			cout<<"\n\n ERROR!!";
			exit(1);
		}
		cout<<"\nEnter file name(destination):";
		cin>>fname1;
		ofile.open(fname1);
		if(!ofile)
		{
			cout<<"\n\n ERROR!!";
			exit(1);
		} 
		cout<<"\nData is copied";
		while(ifile)
		{
			ifile.get(ch);
			ofile.put(ch);
		}
		ifile.close();
		ofile.close();
	}
	void cut()
	{
		cout<<"\nEnter file name(source):";
		cin>>fname;
		ifile.open(fname);
		if(!ifile)
		{
			cout<<"\n\n ERROR!!";
			exit(1);
		}
		cout<<"\nEnter file name(destination):";
		cin>>fname1;
		ofile.open(fname1);
		if(!ofile)
		{
			cout<<"\n\n ERROR!!";
			exit(1);
		} 
		cout<<"\nData is cut and pasted !!";
		while(ifile)
		{
			ifile.get(ch);
			ofile.put(ch);
		}
		ofile.close();
		ifile.close();
		remove("fname");
	}
};

int main()
{
	int opt;
	text_file t;
	cout<<"\n1. Create";
	cout<<"\n2. Read";
	cout<<"\n3. Copy";
	cout<<"\n4. Cut";
	cout<<"\nEnter option";
	cin>>opt;
	switch(opt)
	{
		case 1: t.create();
			break;
		case 2:	t.read();
			break;
		case 3:	t.copy();
			break;
		case 4:	t.cut();
			break;
		default: cout<<"\nWrong option!!";
	}
	return 0;
}

DevOps Consultant