摘要:
void function() const{}通常我们会看到一些函数声明后面会跟着一个const,这个const是做什么的呢?看一下下面的例子,就知道了。直接在编译前,就会提示下面的两个错误// test1107.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include using namespace std;class aa{ int num;public: aa(){ int b =10; num = b; }; void out1(){ cout<<num<<endl; } ... 阅读全文
posted @ 2013-11-07 18:35
xingoo
阅读(47017)
评论(2)
推荐(9)

浙公网安备 33010602011771号