请使用VC6或使用【答题】菜单打开考生目录proj3下的工程文件proj3,此工程中包含一个源程序文件proj
class doc { private: char*sir;//文本字符串首地址 int length;//文本字符个数 public: //构造函数,读取文件内容,用于初始化新对象,filename是文件名字符串首地址 doc(char*filename); void reverse;//将字符序列反转 一doc; void writeToFile(char*filename); }; doc::doc(char}filename) { ifstream myFile(filename); int len=1001,tmp; atr=new char[1en]; length=0; while((trap=myFile.get)!=EOF) { str[1ength++]=trap; } str[1ength]=‘\0’; myFile.close; } void doc::reverse{ //将数组atr中的length个字符中的第一个字符与最后一个字符交换,第二个字符与倒数第二个 //字符交换…… //*************333*************
//*************666*************
} doc::~doe { delete[]str; } void doc::writeToFile(char*filename) { Ofstream outFile(filename); outFile<<str; outFile.close; } void main { doc myDoc(”in.dat”); myDoc.reveme; myDoc.writeToFile(”out.dat”); }