[Gllug] data segment vs stack

t.clarke tim at seacon.co.uk
Tue Feb 14 11:10:58 UTC 2006


Hi

Apologies if this question seems silly,  but I am just curious as to whether
the variables declared in the 'main()' function of a C program are created
in the program's stack (in the same manner as variables declared in any
'subsidiary' functions), or in the data segment  (which is where I assume
'global' variables are created?)

Can anyone enlighten me or point to a web resource that explains ?

Tim

--------------------------------------------------------------------------------
This E-Mail (and any files transmitted with it) is intended solely for the use
of the individual or entity to whom it is addressed. If you have received it in
error please notify the sender and delete the message.

-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list