[HELP] Switching two variables
I need a function for switching two variables.
In Pascal it would look like this: Code:
procedure smt(var x,y:real); |
Re: [HELP] Switching two variables
Well...
PHP Code:
|
Re: [HELP] Switching two variables
Is there a way to put this in some function so I could call it like this:
replace(var1,var2) and it will replace those two vars |
Re: [HELP] Switching two variables
I think this
PHP Code:
|
Re: [HELP] Switching two variables
Anakin. That can't be done with global variables so you should return them.
|
Re: [HELP] Switching two variables
Code:
new a = 2, b = 4 |
Re: [HELP] Switching two variables
Quote:
|
Re: [HELP] Switching two variables
Yeah...i saw now.
|
Re: [HELP] Switching two variables
SnoW, yes it can:
Code:
daniel, won't that only work because those are 2 numbers that are able to do that? What about 3 and 7? |
Re: [HELP] Switching two variables
Quote:
Code:
new a = 3, b = 7 //a = 011b, b = 111b) |
| All times are GMT -4. The time now is 23:10. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.