This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: init variables


Hi Max,

Static variables are initialized to zero.

Stack variables are initialized to garbage.

Heap variables are initialized to garbage (although the original extant from the OS used by the heap is initially initialized to zero, in all modern OS's).

No compiler option needed, it's automatic.

HTH,
--Eljay



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]