AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   ++variable? (https://forums.alliedmods.net/showthread.php?t=132375)

mottzi 07-14-2010 16:06

++variable?
 
Hello!

I saw this two times today:

PHP Code:

if(++integer_example == blablahhhh

Is this like?

Code:

If the integer_example + 1 == Blablabla
so int_example++ and ++int_example are the same?

ot_207 07-14-2010 16:11

Re: ++variable?
 
No, they are not the same.
Code:

y = ++variable + x
Means
Code:

variable = variable + 1
y = variable  + x

And

Code:

y = variable++ + x
Means
Code:

y = variable + x
variable = 1 + variable


PattyBiena 07-14-2010 16:12

Re: ++variable?
 
if ( (variable + 1) == blabla )

mottzi 07-14-2010 16:24

Re: ++variable?
 
thank you very much :)


All times are GMT -4. The time now is 07:15.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.