Mailinglist Archive: opensuse-programming (96 mails)

< Previous Next >
Re: [suse-programming-e] Pointer strangeness
  • From: "Steven T. Hatton" <hattons@xxxxxxxxxxxxxxxxxx>
  • Date: Mon, 31 Mar 2003 10:48:43 -0500
  • Message-id: <200303311048.43633.hattons@xxxxxxxxxxxxxxxxxx>
On Monday 31 March 2003 10:08 am, Steven T. Hatton wrote:

>
> > I hope that the above information has been useful.
>
> Indeed. I guess the most important thing I got out of it is that pointers
> don't control the memory they point to. I guess I knew that at one point,
> I just got used to Java's way of keeping track of references. The same can
> be done in C++, but we have to do it ourselves. If I want to keep the
> data in a variable from getting zapped, I have to keep the variable
> alive(in scope, or static). Is that pretty much a correct statement?

Let me refine this. Upon reflection, I realized what I said is only accurate
regarding fundamental types. Objects are the other way around. I have to
tell them to go away explicitly, or they just sit there and take space. And
if I don't to that before I remove the last pointer to the object, then I
have not way to access the destructor.

> STH


< Previous Next >
List Navigation
Follow Ups
References