Re: couple of general questions

From: Francis Glassborow (francis_at_robinton.demon.co.uk)
Date: 04/05/04


Date: Mon, 5 Apr 2004 20:48:05 +0100

In message <Jfecc.14389$L_8.1387@news01.bloor.is.net.cable.rogers.com>,
Snake <hana1@rogers.com> writes
>Hello there,
> I just wanna say that I am not beginner in this area also my questions
>might seem kinda beginner. I studdied OO and polymorphism and all those
>things.Infact, I am even a Teaching Assistant for advanced C++ course.

Well teaching is an excellent way to learn about ones deficiencies:-)
And I am glad to see that you recognise the need to learn more for the
benefit of your students, however I very much doubt that the course is
actually about advanced C++ even if that is its title.

>butI
>am asking about things I never thought of (since they are very basic and I
>know them by practice not by theory) .For example, I have been programming
>for two years and as I know,I only put a setructor when creating a pointers
>(dynamecally allocated )

While having dynamically allocated resources handled by a raw pointer is
certainly a reason for having a non-trivial destructor it is far from
being the only reason.

> in the class.But I actually never thought about the
>cases of simple classes where we dont use pointers neither destructor
>whether destructor is automatically called nothing like this exists!!Now do
>you undersant my point of confusion.The questions that I asked I already
>have a general idea especially in experimental way but when it comes to
>theory, this is where my confusion comes.I think I should've clarified what
>I know and ask about something more specific as GARY said (I believe) .

While not questioning your practical experience and expertise I think
you need to do some pretty heavy reading if you are to fill the role of
TA for any sort of C++ course, teaching requires the ability to make
things explicit even when implicit understanding is enough for personal
performance.

-- 
Francis Glassborow      ACCU
Author of 'You Can Do It!' see http://www.spellen.org/youcandoit
For project ideas and contributions: http://www.spellen.org/youcandoit/projects


Relevant Pages

  • Re: couple of general questions
    ... > I just wanna say that I am not beginner in this area also my questions ... > might seem kinda beginner. ... > cases of simple classes where we dont use pointers neither destructor ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Derived destructor not being called
    ... between class pointers. ... I've been working on an IDL implementention and I'm having problems ... interface IMyDerived: IMyBase { ... // I'm hoping that the destructor in CMyDerived will be called ...
    (microsoft.public.vc.language)
  • Re: Missing destructor calls on exit
    ... Some from a modeless dialog (whose ... Try steping through the destructor to find what goes wrong. ... up with wild pointers to where the object was. ... The other dll might or might not have a seperate heap. ...
    (microsoft.public.vc.mfc)
  • Re: Allowing at most 2 instances
    ... >i had a couple of cout statements before and after the try. ... >i figured it might have to do with memory cleanup...but i am not really sure ... Remember that, normally, there's one destructor call to match each ... the client manage the pointers (rather than trying to keep them ...
    (alt.comp.lang.learn.c-cpp)
  • Re: correctly cleaning up and exiting the app.
    ... > | error when storing raw pointers in containers is to forget to delete ... container destruction in this instance is a two stage ... > command design pattern. ... > The problem is that I don't see what the destructor does to my ...
    (alt.comp.lang.learn.c-cpp)