Re: object-oriented C programming
On Mon, 4 Dec 2000, Philip Brown wrote:
> I have to preface by saying that this does not LOOK like object-oriented
> programming, for those people coming from a java or C++ background.
> But if you think about it, it is.
What you've show is data abstraction, _not_ object-oriented programming.
To do OOP you'd need a table of function pointers or a similar
structure to implement virtual functions/messages and probably some
macros to make it all look nice. OOP implies a "foo isa
bar" relationship.
Can it be done in C? Sure. But why anyone would use C for this instead
of C++ is beyond me.
-Dave
--
"Some little people have music in them, but Fats, he was all music,
and you know how big he was." -- James P. Johnson
Reply to: