文件名称:asd
介绍说明--下载内容均来自于网络,请自行研究使用
1. 编写程序完成如下功能:
⑴ 编写一个自己的字符串类MyString,它有一个私有的数据成员:指向字符串的指针m_data。编写该类的构造函数、拷贝构造函数和析构函数,在构造函数和拷贝构造函数中动态申请内存空间赋值给m_data。用于存储字符串。在析构函数中释放内存空间。
⑵ 重载运算符“+”作为类MyString的成员函数,使能完成字符串相加功能。
⑶ 编写main函数,测试该类及被重载的运算符。-A written procedure performs the following functions: ⑴ write a string class MyString, it has a private data member: pointers to strings m_data. Write the class constructor, copy constructor and destructor, constructor and copy constructor dynamic application memory space assigned to m_data. For storing strings. Destructor to free up memory space. ⑵ overloaded operators " +" as a the class MyString member function, so that the complete string together. ⑶ write the main function to test the class and overloaded operators.
⑴ 编写一个自己的字符串类MyString,它有一个私有的数据成员:指向字符串的指针m_data。编写该类的构造函数、拷贝构造函数和析构函数,在构造函数和拷贝构造函数中动态申请内存空间赋值给m_data。用于存储字符串。在析构函数中释放内存空间。
⑵ 重载运算符“+”作为类MyString的成员函数,使能完成字符串相加功能。
⑶ 编写main函数,测试该类及被重载的运算符。-A written procedure performs the following functions: ⑴ write a string class MyString, it has a private data member: pointers to strings m_data. Write the class constructor, copy constructor and destructor, constructor and copy constructor dynamic application memory space assigned to m_data. For storing strings. Destructor to free up memory space. ⑵ overloaded operators " +" as a the class MyString member function, so that the complete string together. ⑶ write the main function to test the class and overloaded operators.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
asd.doc