C++构建String类:
举个例子如下:
#include <iostream>
#include <stdlib.h>
#include <string.h>
using namespace std;
class String
{
public:
//String的构造函数
String(const char *str = NULL)
{
cout << "构造函数!" << endl;
if(NULL == str){ //为空则构造空字符串
//m_data = NULL; /