文件名称:daima3
下载
别用迅雷、360浏览器下载。
如迅雷强制弹出,可右键点击选“另存为”。
失败请重下,重下不扣分。
如迅雷强制弹出,可右键点击选“另存为”。
失败请重下,重下不扣分。
介绍说明--下载内容均来自于网络,请自行研究使用
1. 编写字符串类CTString,设计样式如下:
class CTString
{
char *m_pData // 用于保存字符数据
int m_nLen // 记录字符长度
public:
// 构造函数和析构函数
CTString()
CTString(char *)
CTString(const CTString&)
~ CTString()
// 其它成员函数
CTString *Copy(CTString*, CTString*) // 拷贝
CTString *Connect(CTString*, CTString*) // 连接
char* Find(CTString*, CTString*) // 查找子串
char* Find(CTString*, char) // 查找字符
void Print() // 打印输出字符串内容
…… // 学生自己扩充成员函数
}
要求学生实现上面成员函数的功能,有能力的同学可以自己扩充类的功能(成员函数)。
2. 编写构造函数和析构函数
要求使用new和delete申请内存空间和释放空间,并注意内存泄漏的问题(空间申请不释放)。
3. 类的测试
编写类功能测试用的主程序,并显示结果。
-1. Write a string class CTString, design style is as follows:
Class CTString
{
Char* m_pData // Used to save the character data
Int m_nLen // record character length
Public:
// Constructors and destructors
CTString ()
CTString (char*)
CTString (const CTString &)
~ CTString ()
// Other member functions
CTString* Copy (CTString*, CTString*) // copy
CTString* Connect (CTString*, CTString*) // Connect
Char* Find (CTString*, CTString*) // find sub-string
Char* Find (CTString*, char) // Find characters
Void Print () // Print the contents of the string
...// Students to expand their membership function
}
Require students to achieve the functions of the above member function, the ability of students can expand their own class function (member function).
2. Write constructors and destructors
Requires the use of new and delete application memory space and the release of space, and pay attention to the problem of memory leak (space applications do not r
class CTString
{
char *m_pData // 用于保存字符数据
int m_nLen // 记录字符长度
public:
// 构造函数和析构函数
CTString()
CTString(char *)
CTString(const CTString&)
~ CTString()
// 其它成员函数
CTString *Copy(CTString*, CTString*) // 拷贝
CTString *Connect(CTString*, CTString*) // 连接
char* Find(CTString*, CTString*) // 查找子串
char* Find(CTString*, char) // 查找字符
void Print() // 打印输出字符串内容
…… // 学生自己扩充成员函数
}
要求学生实现上面成员函数的功能,有能力的同学可以自己扩充类的功能(成员函数)。
2. 编写构造函数和析构函数
要求使用new和delete申请内存空间和释放空间,并注意内存泄漏的问题(空间申请不释放)。
3. 类的测试
编写类功能测试用的主程序,并显示结果。
-1. Write a string class CTString, design style is as follows:
Class CTString
{
Char* m_pData // Used to save the character data
Int m_nLen // record character length
Public:
// Constructors and destructors
CTString ()
CTString (char*)
CTString (const CTString &)
~ CTString ()
// Other member functions
CTString* Copy (CTString*, CTString*) // copy
CTString* Connect (CTString*, CTString*) // Connect
Char* Find (CTString*, CTString*) // find sub-string
Char* Find (CTString*, char) // Find characters
Void Print () // Print the contents of the string
...// Students to expand their membership function
}
Require students to achieve the functions of the above member function, the ability of students can expand their own class function (member function).
2. Write constructors and destructors
Requires the use of new and delete application memory space and the release of space, and pay attention to the problem of memory leak (space applications do not r
(系统自动生成,下载前可以参看下载内容)
下载文件列表
daima3.doc