fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void foo(const int& a) {
  5. cout<<a + 5<<endl;
  6. }
  7.  
  8. int main() {
  9. int* b = new int();
  10. *b = 5;
  11. foo(b);
  12. cout<<b<<endl;
  13. return 0;
  14. }
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: invalid conversion from ‘int*’ to ‘int’ [-fpermissive]
  foo(b);
       ^
prog.cpp:4:6: note:   initializing argument 1 of ‘void foo(const int&)’
 void foo(const int& a) {
      ^~~
stdout
Standard output is empty