|Pointers to global and stack variables email@example.com (shrey) (2005-11-26)|
|Re: Pointers to global and stack variables firstname.lastname@example.org (2005-11-27)|
|Re: Pointers to global and stack variables email@example.com (Karsten Nyblad) (2005-11-29)|
|Re: Pointers to global and stack variables alexc@TheWorld.com (Alex Colvin) (2005-11-30)|
|From:||Alex Colvin <alexc@TheWorld.com>|
|Date:||30 Nov 2005 17:29:11 -0500|
|Organization:||The World : www.TheWorld.com : Since 1989|
>> I am trying to understand what might be a few major and general
>>reasons why programmers might have pointers to global and stack data as
>>compared to pointers to heap which are essential to building data
There are a couple of uses that I can think of. The most important is
call-by-reference. You want to be able to pass the address of a local
or global variable for modification, or pass a pointer to large object
to avoid copying.
In languages like Pascal, this doesn't look like a pointer (which can
really only point to the heap), but in C it's a pointer just like a
In Java this is necessarily a heap pointer - you can't call by
reference and you can't point to a non-object.
Another use, as was pointed out, is statically constructed linked
mac the naïf
Return to the
Search the comp.compilers archives again.