[prev in list] [next in list] [prev in thread] [next in thread] 

List:       suse-programming-e
Subject:    Re: [suse-programming-e] Pointer strangeness
From:       Jerry Feldman <gfeldman () attbi ! com>
Date:       2003-03-31 18:03:39
[Download RAW message or body]

On Mon, 31 Mar 2003 10:48:43 -0500
"Steven T. Hatton" <hattons@globalsymmetry.com> wrote:

> 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.
When a variable goes out of scope, a destructor is called. 
I suggest that when you are learning C++, start by writing your own
classes. Then, once you understand the language, then start using the
STL and other class libraries. The STL has a large number of container
types, such as vector, link lists, trees et. al. But, while these are
great to use, the details of the implementation are hidden. That's not a
bad thing, but when you are learning a language you are not learning
some of the finer points of that language. For instance, a person who
does not know Java can pick up JBuilder and build some programs, but not
lean how to write Java code. In C++, you should first lean the basics of
the language, then move up to writing some classes. Then learn multiple
inheritance and templates. The problem is the time tradeoff. Most of us
want to be productive and get something out the door, or use the skills
on the job. 


-- 
--
Gerald Feldman <gfeldman@attbi.com>
Boston Computer Solutions and Consulting
ICQ#156300 PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9

-- 
To unsubscribe, email: suse-programming-e-unsubscribe@suse.com
For additional commands, email: suse-programming-e-help@suse.com
Archives can be found at: http://lists/archive/suse-programming-e

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic