Re: doubt on regarding stacks
From: pmm (muralipmanohar_at_hotmail.com)
Date: 02/24/05
- Next message: Michael Mair: "Re: assembly in a C language program"
- Previous message: infobahn: "Re: doubt on regarding stacks"
- In reply to: dandelion: "Re: doubt on regarding stacks"
- Next in thread: dandelion: "Re: doubt on regarding stacks"
- Reply: dandelion: "Re: doubt on regarding stacks"
- Reply: DHOLLINGSWORTH2: "Re: doubt on regarding stacks"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 24 Feb 2005 04:18:56 -0800
dandelion wrote:
> "Richard Bos" <rlb@hoekstra-uitgeverij.nl> wrote in message
> news:421dbcd8.68437036@news.individual.net...
> > "pmm" <muralipmanohar@hotmail.com> wrote:
> >
> > > Is there any way to know in which direction stack grows
> >
> > Not in ISO C. In fact, ISO C does not guarantee that you even
_have_ a
> > stack as you understand that term.
>
> Correct, of course, but OTOH, you would have a pretty unusual
platform if
> you did not.
>
> One filthy trick you could employ (with all warnings set abut
> non-portability and compliance) is to
> take the address of some local variable, call a function allocating
another
> local and take that address,too. Then a simple comparison of the
addresses
> would yield the direction in which the stack grows (assuming your
compiler
> does indeed have a stack and uses it).
>
> However, that falls into the "Filthy Tricks" department and you no
> guarantees whatsoever that it will indeed work on your target
platform.
>
> Usually consulting the documentation on your CPU/Compiler will yield
more
> reliable answers.
Thanks for the reply
I sure did the above trick but I felt like a bad practice. I thought of
to have a better code so I posted into this group.
plz let me know the correct concepts. please recommend any web pages
deals with the above concepts
thanks a lot
- Next message: Michael Mair: "Re: assembly in a C language program"
- Previous message: infobahn: "Re: doubt on regarding stacks"
- In reply to: dandelion: "Re: doubt on regarding stacks"
- Next in thread: dandelion: "Re: doubt on regarding stacks"
- Reply: dandelion: "Re: doubt on regarding stacks"
- Reply: DHOLLINGSWORTH2: "Re: doubt on regarding stacks"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|