- 论坛徽章:
- 0
|
本帖最后由 aoyang888 于 2011-08-18 19:42 编辑
#include <iostream>
using namespace std;
class String
{
public:
String(const char* cstr = NULL); //构造函数
~String(void); //析构函数
String(const String &other); //复制构造函数
String &operator = (const String & other); //复制运算符
String *operator &(); //取地址运算符
const String *operator &()const; //取地址运算符const
friend ostream &operator<<(ostream &output, const String &other);
friend istream &operator>>(istream &input, const String &other);
private:
char *str;
}
都来看看,进来了就别放过这个问题,锻炼一下基本功。
各位能补充的尽量补充,谢谢! |
|