12.04.2013, 14:25
Quote:
The preprocessor will simply change MAX_PLAYERS to 500 and MAX_VEHICLES to 2000 before compiling there is no optimization, the only benefit you get is the values can be changed in one place which will affect the code anywhere those defines are used. So really the only optimization is saving you coding time by changing one value instead of potentially hundreds.
|
Quote:
Yes, that would be correct. If you then used x elsewhere in the code, it would be equal to 1000000
|
Quote:
What he's asking is, does the compiler interpret that as a constant expression (right word?) and make it 1000000, or does it store the multiplication and process that every time 'x' is declared.
I'm not sure. |
I wanted to ask if the compiler will have to calculate the operation between the constants when I want to assign it to x, or if it will replace it as 1000000 and assign it to x.