Which area of RAM does static variables get stored?

Showing Answers 1 - 15 of 15 Answers

chsuryaprakash

  • May 28th, 2007
 

The static variable if it is initialised then it will be stored in data section. if it is uninitialized then it will store in bss section

  Was this answer useful?  Yes

Manish Katiyar

  • Jun 19th, 2007
 

There is no standard which says where static variables will be stored. It depends on the compiler where it stores. Most of the times it is in RAM. The only thing that the standard says is that it will have the lifetime equal to that of process.

Thanks

  Was this answer useful?  Yes

muthu

  • Jun 20th, 2007
 

Static is stored in the RAM -TPA area

The TPA is subdivided to code segment and data segment.

Static variable having the permenant storage area. It is stored in TPA-Code area.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions