Posts: 577
Threads: 183
Joined: Jun 2013
Reputation:
0
Hey there, does an enumerator use memory ?
Or is it really just similar to a define
Posts: 2,856
Threads: 6
Joined: Jun 2007
Reputation:
0
No they aren't stored in memory
An enum is just an easy way to create a list of tagged / untagged constants
Posts: 1,219
Threads: 51
Joined: Jul 2012
Quote:
Originally Posted by Nero_3D
No they aren't stored in memory
An enum is just an easy way to create a list of tagged / untagged constants
|
Actually that's wrong, all variables are stored in ram(Or in some cases in the CPU cache? dunno) , even the code is, how else would you have the speed that you need, obviously not by storing variables on hard drive.
Posts: 1,219
Threads: 51
Joined: Jul 2012
20.11.2016, 10:48
(
Последний раз редактировалось dugi; 20.11.2016 в 12:57.
)
but where is it stored if not in the memory? All information has to be stored somewhere not just variables, so explain pls
Or do u mean that they are replaced on compiletime?
Posts: 4,759
Threads: 33
Joined: Dec 2013
Reputation:
0
Enumerators are the same as macros. Variables with assigned enumerators are the ones storing things.
P.S. Double posting isn't allowed. Use the edit button.
Posts: 1,219
Threads: 51
Joined: Jul 2012
u didn't get my point i think ^^ what i meant was, that not only values are be stored (depending on how u define stored).
Posts: 1,939
Threads: 11
Joined: Oct 2015
Reputation:
0
no they are just constant values and not variables .They are not saved in the memory