v 0. Pasted by Anonymous as cpp at 2012-10-24 13:06:17 MSK and set expiration to never.

Paste will expire never.

  1. class Imp
  2. {
  3.      Imp() { val = 9; }
  4.      string GetStr() { return "" + val; }
  5.      int val;
  6. }
  7. void startGame( string &param )
  8. {
  9.      Imp im = Imp();
  10.      Imp @im2 = Imp();
  11.  
  12.      im2.val = 99;
  13.  
  14.      im2 = im; // Why need copy, why why why ? im2 its Reference!
  15.  
  16.      im.val = 0;
  17.  
  18.      output( "im: " + im.GetStr() );
  19.  
  20.      output( "im2: " + im2.GetStr() );
  21. }