Swap variables without using temp

View previous topic View next topic Go down

Swap variables without using temp

Post  Admin on Wed Aug 24, 2011 3:18 pm

a=a^b
b=a^b
a=a^b

Admin
Admin

Posts : 131
Join date : 2011-08-16

View user profile http://codefornongeek.forumotion.com

Back to top Go down

Re: Swap variables without using temp

Post  viterbi on Thu Sep 08, 2011 9:59 pm

This only works for integer, there is another version which work for float

a = a+b;
b = a-b;
a = a-b;

viterbi

Posts : 32
Join date : 2011-09-03

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum