SHARE
TWEET

Invalid reference

Archon Apr 26th, 2012 28 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. int main(){
  4.    int *p = new int;
  5.    int &r = *p;
  6.    r = 1;
  7.    delete p;
  8.    r = 2;
  9.    std::cout << *(int*)p << std::endl;
  10. }
RAW Paste Data
Top