Re: Array object operator overloading
From: Ivan Vecerina (NOT_VALID_please_use_contact_webform_at_vecerina.com)
Date: 01/27/05
- Next message: Attila Feher: "Re: Correct C++ tutorial part 3 "Intro to loops" available (Windows, mingw/msvc/std)"
- Previous message: Attila Feher: "Re: Shrink vector capacity?"
- In reply to: Ramprasad A Padmanabhan: "Re: Array object operator overloading"
- Next in thread: Ivan Vecerina: "Re: Array object operator overloading"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 27 Jan 2005 14:28:33 +0100
"Ramprasad A Padmanabhan" <ramprasad.padmanabhan@oracle.com> wrote in
message news:41F8EB2E.6020101@oracle.com...
> I thought I should bother about memory leak later , So I dropped my
> destructor.
> Now my code is working fine. So how do I free the memory allocated to int
> *data
As Ron and I pointed out, the problem is not (just) the destructor,
but the copy-constructor and copy-assignment operator that you need
to implement as well.
But you don't need to bother, just use std::vector ( or std::valarray ).
-- http://ivan.vecerina.com/contact/?subject=NG_POST <- email contact form
- Next message: Attila Feher: "Re: Correct C++ tutorial part 3 "Intro to loops" available (Windows, mingw/msvc/std)"
- Previous message: Attila Feher: "Re: Shrink vector capacity?"
- In reply to: Ramprasad A Padmanabhan: "Re: Array object operator overloading"
- Next in thread: Ivan Vecerina: "Re: Array object operator overloading"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|