Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Where a static variable is stored

Status
Not open for further replies.

123music

Junior Member level 1
Joined
Jun 24, 2010
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,381
Where is a static variable stored in memory?Is it in .bss section??
How compiler distinguishes between global variable and static variable..?
 

Static variables are stored in the same place as global variables. If your compiler produces a map-file, take a look at it.
The compiler knows the difference because you declared them to be different.
 

wade_hassler said:
Static variables are stored in the same place as global variables. If your compiler produces a map-file, take a look at it.
The compiler knows the difference because you declared them to be different.

If there are stored at the same place as global, why the scope of static variables is limited??
I want to know what additional symbol information the compiler will add to a static variable so that it can distinguish from global variables?
 

please check the wiki link i sent earlier.
--
Amr
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top