HenriAugusto

operator++ possible implementations

Oct 14th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.16 KB | None | 0 0
  1. //possibility 1
  2. int operator++(&i){
  3.     i = i+1;
  4.     return i-1;
  5. }
  6.  
  7. //possibility 2
  8. int operator++(&i){
  9.     int temp_i = i;
  10.     i = i+1;
  11.     return temp_i;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment