⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mutable.cpp

📁 本代码是《C/C++程序员实用大全》的配套代码。网络转载
💻 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 + -