Advertisement
Guest User

Untitled

a guest
Nov 25th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.17 KB | None | 0 0
  1. int* foo() {
  2.     int a = 20;
  3.     return &a;
  4. }
  5.  
  6. int& bar() {
  7.     int a = 20;
  8.     return a;
  9. }
  10.  
  11.  
  12. int main()
  13. {
  14.  
  15.     int* a1 = foo();
  16.     int& a2 = bar();
  17.    
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement