whiplk

[CODE] - swap vars

Mar 15th, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.17 KB | None | 0 0
  1. //Inveter valores das variáveis it1 com it2, independente que seja int, float, char...
  2. void swap(void *&it1, void *&it2)
  3. {
  4.     void *ex = it1;
  5.     it1 = it2;
  6.     it2 = ex;
  7. }
Advertisement
Add Comment
Please, Sign In to add comment