xxx of yyy characters
Join Group

#1 place for windows tips, c/c++, java and visual basic help

Google Translation: Off

When Google Translation is on, topics and messages in this group will be machine-translated to your language by Google.

Messages


Topic: Math question
This related to programming ofcourse!
I just want to know if anyone here can figure this little trick i come up with switching variables. (I think there is probably someone else who has found this trick before me)

So the question is can you switch variables without accounting the 3rd variable(space)?

For example:
var temp1 = a or 1
var temp2 = b or 2
var space = null

space = temp1
temp1 = temp2
temp2 = space

so now the variable is switched

temp1 = b or 2
temp2 = a or 1

This is normally a normal method if you want to swap variables but there is a way to swap it just using 2 variables. There you go figure this out :)
Aug 17
6:53 PM

Posted by T Chaiyaphan

Note: To add an image or link in your message, use <img src="http://www.hi5.com/example.jpg"> or <a href="http://www.hi5.com/example.html">Text </a>

 
 

  

Title
body