fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class What
  5. {
  6. private:
  7. int & ohNo;
  8. };
  9.  
  10. int main() {
  11. What what;
  12. return 0;
  13. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:11:7: error: use of deleted function 'What::What()'
  What what;
       ^
prog.cpp:4:7: note: 'What::What()' is implicitly deleted because the default definition would be ill-formed:
 class What
       ^
prog.cpp:4:7: error: uninitialized reference member in 'class What'
prog.cpp:7:9: note: 'int& What::ohNo' should be initialized
   int & ohNo;
         ^
stdout
Standard output is empty