Re: [CODE] Confuzius about pointers and stuff

From: Peter Ajamian (peter@pajamian.dhs.org)
Date: 10/03/00


The Merciless Lord of Everything wrote:
>
> On Mon, 2 Oct 2000, Peter Ajamian wrote:
>
> >  Note that unlike a pointer you cannot change what this variable
> > points to, it is constant and will always point to the same area of
> > memory.
> I do realize that I would be grabbing a bit of memory, but a pointer
> surely grabs memory as well yes? (be that random memory :). But I'm not
> sure I understand the problem with having it point to the same area of
> memory?

Barring the small amount of memory used to hold the pointer itself no
memory is allocated for a pointer.  When you define a pointer it will be
pointing to a random area of memory, however if you attempt to read or
write to that area of memory before initializing the pointer you will
most likely end up with a seg fault or worse.

Regards, peter


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT