Difference between static and const | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Difference between static and const

6th Aug 2017, 4:00 AM
‎ ‏‏‎Anonymous Guy
3 Answers
+ 2
Thanks @Hatsy! 💾
6th Aug 2017, 4:48 AM
Manual
Manual - avatar
+ 2
const variables are typically stored in the .rdata section, which is read only access. Static variables are stored in .data section, and so their address remains the same in your process across all classes or functions. This is useful because you won't have to pass any references around, nor have to store them globally
6th Aug 2017, 5:49 AM
aklex
aklex - avatar