sorry guys easy question here what is this +=, what does this do and what is its name in programming so i find what the other ones like it do *= /= -= ...
sorry guys easy question here what is this +=, what does this do and what is its name in programming so i find what the other ones like it do *= /= -= ...
+= increments variables by the given number. Say you have a variable X that is 4,
X = 4
X += 2
X is now 6.
The other ones are just different math operators, i.e.
*= is multiplication
/= is division
-= is subtraction
X += Y and the others are just a shorter form of writing
X = X + Y
If you only need to increment by 1 each time, you can use X++ as opposed to X = X + 1.
In C are those shortcuts also better for the performance (if the compiler is halfway decent) because it can tell the CPU that it only needs to look up X once and not twice. But I don't know if the UnrealScript compiler/interpreter makes use of such kind of optimization.
Our Loop, which art in source code, hallowed be thy keyword.
Thy condition come, thy instruction be done, in RAM as it is in cache.
Increment us this day our daily counter,
and forgive us our typos, as we also have forgiven our compilers.
And lead us not to the nullpointer but deliver us from bugs.
For thine is the API, the GUI, and the CLI while(true).
Semicolon;Please don't send me questions about how to do something in the UDK via PM. That is better discussed in the forums and we only have limited PM storage.
x+=2 is simply short for x=x+2
Bookmarks