temporary2.c

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

C
17
字号
class X // Indentation has been done so to see the similarities.{public:  X() {}		  // ERROR - referenced below         X(X& x) {x.i=7;} // ERROR - Both functions modify the  void bar(X& x) {x.i=7;} // ERROR - reference parameter x.  int i;};X foo() { X x; return x; }int main() {  X   x(foo()); // ERROR - Compiler doesn't warn about temporary reference.  x.bar(foo()); // ERROR - The same mistake is warned about in this case.}

⌨️ 快捷键说明

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