On Mon, Aug 4, 2008 at 2:51 PM, thides <[EMAIL PROTECTED]> wrote:

> After doing some old textbook reading I think that its constructors
> and destructors that structs can't use.

In C++, you can create constructors and destructors for struct. They
work the same as classes except they default to public access for
members (classes default to private).

> As for malloc() and structures according to my reading (ten year old
> books) can be used together in C as the only way to allocate memory
> on the heap is malloc() - new is a C++ keyword. With that in mind,
> the code for allocation using malloc() and structures really looks
> messy opposed to the clean and trim new. My preference in C++ would
> most definitely be new.

Definitely... but you have to be careful of how things are initialized
"by default" or else you can run into trouble.

-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
 If I were to divulge it, it would overturn the world."
 -- Jelaleddin Rumi

Reply via email to