M
M
MishkaVNorky2019-09-02 08:44:04
C++ / C#
MishkaVNorky, 2019-09-02 08:44:04

I correctly understand that constants are the fastest?

I understand correctly that when the game is compiled, instead of constants (for example, "APP_ID = 4444"), he puts the value directly?
That is, the program / game does not need to go to the constant to look at its value, but the value is set directly during compilation?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nrgian, 2019-09-02
@MishkaVNorky

No.
Modern compilers themselves are able to optimize.
And if you do not change the usual variable, it will also, with a high probability, behave like a constant.
But on average and in general - yes, as you think.
The above only applies to primitive/base types. With some dictionaries-arrays-trees - this will not work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question