摘要: 构造方法,析构方法#include using namespace std;class Object {public: Object(){//定义Object的构造方法,此名称必须与class的名称相同 printf("gouzao\n"); } ~Object(){... 阅读全文
posted @ 2015-03-26 22:05 hanjing 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 继承:Man继承People类main函数中这么写#include #include "Man.h"using namespace std;//#include "People.h"int main(){ Man *m = new Man(); m->sayhello(); del... 阅读全文
posted @ 2015-03-26 16:21 hanjing 阅读(148) 评论(0) 推荐(0) 编辑