博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年11月6日

摘要: 《C++ Primer Plus》第12章的编程练习2。这一章介绍类和动态内存分配,相当精彩。编写简单的String类,并测试。 1 //string1.h -- fixed and augmented string class defination 2 #include <iostream> 3 using std::ostream; 4 using std::istream; 5 6 #ifndef STRING1_H_ 7 #define STRING1_H_ 8 class String 9 {10 private:11 char *str; // pointer to.. 阅读全文

posted @ 2012-11-06 10:13 子水 阅读(1025) 评论(0) 推荐(0)