珞珈山水BBS电脑网络程序人生 → 单文区文章阅读

单文区文章阅读 [返回]
发信人: crescentup (BamBoo), 信区: Programm
标  题: 怎样编写类String的构造函数、析构函数和赋值函数 ?
发信站: BBS 珞珈山水站 (Wed Apr 20 16:16:40 2005)

编写类String的构造函数、析构函数和赋值函数 
 已知类String的原型为:  

class String  {  

public:  

 String(const char *str = NULL);  

 String(const String &other);  

 ~ String(void);  

 String & operate =(const String &other); private:  

 char *m_data; // 用于保存字符串  
 };  


--

※ 来源:·珞珈山水BBS站 http://bbs.whu.edu.cn·[FROM: 162.105.239.*]
[返回单文区目录]

武汉大学BBS 珞珈山水站 All rights reserved.
wForum , 页面执行时间:12.809毫秒