print() and delete() need context, so you need to pass that as parameter. Also, type the argument, do not declare it void and cast it in-function.
Name:
Anonymous2012-06-13 21:39
Nope, welcome to C
Name:
Anonymous2012-06-13 22:52
Why don't you just use C++. It won't be any less inefficient and you get to take advantage of the syntactical transforms like automatic this insertion.
The function pointers should be put in a vtable if you really want them to be virtual, if not then it's completely unneeded.
Name:
Anonymous2012-06-13 23:05
Object Oriented Programming is Computational Marxism. It tries to forcefully make everything the same, even when it doesn't make sense--it tries to treat everything as objects.
Name:
Anonymous2012-06-14 0:14
Yes; just write a simple preprocessor that will do the transformation for you.
Please don't do this. If you want OOP in that style so badly, use C++. Otherwise, don't waste memory on creating a function pointer for every single object initialized.
>>10
It can be useful if you want each object to have a different mix of functions and change them on a per-object basis, something you can do when explicitly OOP in C but not as easily with C++'s built-in OOP.