You though you are doing quite well, but you are not. As Mr. Kirunge said,
malloc can't do many things, it just alloc a memory space. Of course you can
implement new by malloc, and in fact that's the way it goes.
I suggest you to google it instead of asking here. I read a lot on this and
it's hard to put them all here.
"Dave Vandervies" <dj3vande@csclub.uwaterloo.ca> ????
news:cugsnp$o77$1@rumours.uwaterloo.ca...[color=blue]
> In article <3729k5F58niqnU1@individual.net>,
> MatrixV <training@kcollege.com> wrote:[color=green]
> >That's explained by lots of books. You can even google it.
> >Simply put, new is OOP, while malloc is not.[/color]
>
> That's odd; I use malloc for OOP quite regularly.
>
> Mind you, I do OOP in C quite regularly (for assorted reasons, most
> of them actually reasonable), and I never use malloc when I'm actually
> writing C++ code, whether I'm doing OOP or not...
>
>
> dave
>
> --
> Dave Vandervies[/color]
dj3vande@csclub.uwaterloo.ca[color=blue]
> My personal best estimate is that 90% of existing C code is crap (F[/color]
various VO[color=blue]
> crap), and 90% of existing NotC code is crap too. (I expect this to be[/color]
true of[color=blue]
> non-existing code as well.) --Dimitri Mazuik in the scary devil[/color]
monastery