|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)|
|Date:||26 Nov 2005 00:21:36 -0500|
|Posted-Date:||26 Nov 2005 00:21:36 EST|
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
structures. Based on that I want to find programs with such pointers.
Some reasons general reasons I can think of are making pointers point
to a array based on runtime conditions, writing obfuscated but compact
code , better code generation in DSP processors etc. Can any one
suggest me any other reasons ?
[The short answer is "because that's what their programs do". There might be
a linked list with dynamically allocated entries but a static head. There
might be some sort of symbol table that has various sorts of subfields, some
of which could be in short lived stack variables.
If the question is whether you could write a language which decreed that pointers
can only point to heap storage, sure, it's been done, but at some loss in
expressive flexibility. -John]
Return to the
Search the comp.compilers archives again.