fork download
  1. #include <stdio.h>
  2. using namespace std;
  3.  
  4. int& func(int& p) {
  5. p++;
  6. return p;
  7. }
  8.  
  9. int main() {
  10. int a = 1;
  11. func(a) = 5;
  12. printf("%d", a);
  13. return 0;
  14. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
5