fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int greet(){
  5. cout<<"hello asha";
  6. return 0;
  7. }
  8.  
  9. int main() {
  10.  
  11. //reference variable
  12.  
  13. // int x=4;
  14. // int y=x;
  15. // y--;
  16. // x++;
  17. // cout<<x<<endl<<y;
  18. int x=7;
  19. int &y=x;
  20. // x++;
  21. // y++;
  22. // cout<<x<<endl<<y;
  23. cout<<&x<<endl; // address of x variable: 0x7ffd868651e4
  24. cout<<&y<<endl;
  25.  
  26. int z=greet();
  27. return 0;
  28. }
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
0x7ffd18c7fa34
0x7ffd18c7fa34
hello asha