Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

C Objects

Name: Help me 2012-06-13 16:33

Name: Anonymous 2012-06-13 16:51

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: Anonymous 2012-06-13 21:39

Nope, welcome to C

Name: Anonymous 2012-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: Anonymous 2012-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: Anonymous 2012-06-14 0:14

Yes; just write a simple preprocessor that will do the transformation for you.

You could name it ``C with Classes''.

Name: Anonymous 2012-06-14 0:18

>>6
Not again!

Name: Anonymous 2012-06-14 3:59

use pointers

Name: Anonymous 2012-06-14 4:00

Name: Anonymous 2012-06-14 4:17

Function pointers in the body of a struct

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.

Name: Anonymous 2012-06-14 4:33

>>7
that's what she said

Name: Anonymous 2012-06-14 5:00

>>11
watch your privilege, dubz getter

Name: Cudder !MhMRSATORI!FBeUS42x4uM+kgp 2012-06-14 6:37

>>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.

Don't change these.
Name: Email:
Entire Thread Thread List