Read all the sticky threads before asking any type of query. Most basic questions are answered in those.
Don't use forum for chatting. Visit http://webchat.freenode.net/?channels=krow, enter nick and connect.
Re: Is it possible to swap two numbers without using a third temporary variable?
Quote:
Originally Posted by nims11
i think it would still require another variable unless the address of two variables are consecutive.
Yes it would require another variable because as soon as you will apply swap on pointer variable the previous value will be gone and you can not do both swaps in single operation.
For swapping follow the approach that nims11 provided.
Read all the sticky threads before asking any type of query. Most basic questions are answered in those.
Don't use forum for chatting. Visit http://webchat.freenode.net/?channels=krow, enter nick and connect.