摘要: // ConsoleApplication1.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include class MyClass { public: MyClass(int* a); MyClass(); ~MyClass(); int GetId() { return 5; } private: }; MyClass::... 阅读全文
posted @ 2016-07-02 19:13 calochCN 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 析构函数在调用默认的析构函数和用户自己覆写的析构函数的时候有点意识模糊呢。写段代码总结下 [cpp] view plain copy #include <iostream> using namespace std; class Box { private: double length; public 阅读全文
posted @ 2016-07-02 18:55 calochCN 阅读(604) 评论(0) 推荐(0) 编辑
摘要: c++中关于const的用法有很多,const既可以修饰变量,也可以函数,不同的环境下,是有不同的含义。今天来讲讲const加在函数前和函数后面的区别。比如: 01 #include<iostream> 02 03 using namespace std; 04 05 // Ahthor: 过往记忆 阅读全文
posted @ 2016-07-02 16:18 calochCN 阅读(2814) 评论(0) 推荐(0) 编辑