This post I made because I just discovered an entry from long time ago, which I forgot to answer.
pseudo code:
int *method_to_append() { return 0; } void *do_something() {} struct foo { int attribute1 : 0; int attribute2 : 0; int *method1 : method_to_append; void *method2 : do_something; }; struct foo new_obj; new_obj->method2();
I thought it was more like:
struct foo;
int *method(struct foo *this) { return this->attribute1; }
struct foo {
int attribute1: 0;
int *method1: method;
}
struct foo new_obj;
new_obj->method1(new_obj);
Oops. Right.
Of course you have to tell the method which object it belongs to,
right.