where is static variable stored ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

This may not exactly be a kernel question, but giving a try.


static variables if defined inside a function, it is defined once and retain values across function calls, so its like global variable in this sense. But it is not exposed to other functions and they can define local variable of the same name[or for that matter, there can also be a global variable of the same name, in which case most 'nearly defined' variable will be used].

My query is, where is static variable stored ? in code section, in which case this should be available to other functions too. On stack ? How is it managed ?

Thanks.

-
Sunil.


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux