p701.c

来自「this is a gcc file, you can download it 」· C语言 代码 · 共 35 行

C
35
字号
// Build don't link:// prms-id: 701extern "C" {  int printf(const char *, ...);};void Munge(int& x) {				// ERROR - referenced below   x = 2;}class A { public:   int i;   A(int x) : i(x) {}   void Safe() const;};voidA::Safe() const {   Munge(i);	// ERROR - should not be able to modify a const object}int main(){   const A a(1);   a.Safe();}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?