lau.dvd@[EMAIL PROTECTED]
wrote:
> Thanks! One last question. . .
>
> So the author of the class has to write the destructor properly so
> that when the class is freed, all related resources are returned - no
> matter when the destruction occurs. And the user does not need to take
> care of that. The compiler automatically instantiate and free the
> class, e.g. when it goes out of scope.
>
> That's my understanding.. I hope that was right =P
That is correct.
>
> And.. are there any good books on these specific issues such as
> cl*****, memory management, etc? The books I tried all talk about how
> to use specific cl***** such as those provided by STL or Boost... but
> not the language itself.
You may not find it all in one book, but there are good books that
discuss these topics.
Any good beginners book should give an introduction to writing cl*****
yourself, but don't be surprised if that only happens in the second
half of the book.
Memory management is often only discussed in combination with new/delete
and that is often considered to be an advanced topic, so it may be
absent in a beginners book. IME, most beginning C++ programmers, even
if they have a C background, don't question the lack of explicit memory
management they see in the C++ programs.
As I am not familiar with the availability and quality of today's
tutorials, I can't give any specific recommendations for a book.
>
> Thanks for your time!
>
> David Lau
Bart v Ingen Schenau
--
a.c.l.l.c-c++ FAQ: http://www.comeaucomputing.com/learn/faq
c.l.c FAQ: http://c-faq.com/
c.l.c++ FAQ: http://www.para****ft.com/c++-faq-lite/


|