Is there any use of using a global variable declared static ?
I have heard static variables are faster than global variables. But why is that so ?
Local variables are stored in stack. Global on heaps. Heard static on data segments.
So is the performance scale like this :
stack access time > heap access time > data segment access

Suggested Topics

Topic Category Replies Views Activity
C and C++ 0 14 6d

Want to read more? Browse other topics in C and C++ or view latest topics.