fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class A {
  5. int *val;
  6. public:
  7. A() { val = new int; *val = 0; }
  8. int get() { ++(*val); return *val; }
  9. };
  10.  
  11. int main() {
  12. A a,b = a;
  13. cout << a.get()
  14. cout << b.get();
  15. return 0;
  16. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:14:9: error: expected ‘;’ before ‘cout’
         cout << b.get();
         ^~~~
stdout
Standard output is empty