📄 mutable.cpp
字号:
#include <iostream.h>
class Alpha
{
mutable int count;
mutable const int* iptr;
public:
Alpha(void) {count = 0;}
int func1(int i = 0) const { // Promises not to change const arguments.
count = i++; // But count can be changed.
iptr = &i;
cout << "i is: " << *iptr << endl;
return count;
}
void show_count(void) { cout << "Count is: " << count << endl;}
};
void main(void)
{
Alpha a;
a.show_count();
a.func1(10);
a.show_count();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -