c - Enum data type memory allocation -


this question has answer here:

how memory allocated for"enum" data type, found total size of enum data type 4 bytes(linux) people answers there no memory allocation, 'macros' type(int) please explain how enum members function stored while accessing , data there in 4 bytes.

thanks

the memory shall not allocated enums. remember memory allocation , processing time

(preprocessor time , compilation time) main difference between macro , enum.

for example, while doing debugging(runtime) not able see value of macro,since memory not allocated macro , not able access memory location. know value of macro, have file defined.

but enums, memory shall allocated. able access memory , see value of enum in debugging time(runtime).

so, if memory not allocated enum, how able know value in runtime. , access , gives value.


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -