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..?
 

wade_hassler

Member level 4
Joined
Aug 7, 2008
Messages
79
Helped
15
Reputation
32
Reaction score
11
Trophy points
1,288
Activity points
1,705
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.
 

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
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?
 

amraldo

Advanced Member level 4
Joined
Aug 29, 2004
Messages
1,185
Helped
145
Reputation
290
Reaction score
40
Trophy points
1,328
Location
Egypt
Activity points
5,880
please check the wiki link i sent earlier.
--
Amr
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top