fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void funcion(int &x);
  5.  
  6. int main(void) {
  7.  
  8. int x=1;
  9.  
  10. printf("%i\n", x);
  11.  
  12. funcion(&x);
  13.  
  14. printf("%i\n", x);
  15.  
  16. return 0;
  17. }
  18.  
  19. void funcion(int &x) {
  20. x++;
  21. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:10:2: error: use of undeclared identifier 'printf'
        printf("%i\n", x);
        ^
prog.cpp:12:2: error: no matching function for call to 'funcion'
        funcion(&x);
        ^~~~~~~
prog.cpp:4:6: note: candidate function not viable: no known conversion from 'int *' to 'int &' for 1st argument; remove &
void funcion(int &x);
     ^
prog.cpp:14:2: error: use of undeclared identifier 'printf'
        printf("%i\n", x);
        ^
3 errors generated.
stdout
Standard output is empty