Name: Anonymous 2013-08-14 1:02
is there some automation tool that converts C++ to C code?
new with malloc().void*.
class c {
public:
c() {}
~c() {}
int not_virtual() { return data; }
virtual int im_virtual() { return data - 1; }
int data;
};
struct c_vtable {
int (*im_virtual)();
};
struct c {
struct c_vtable* vtable;
int data;
}
void c_constructor(struct c* this) {
}
void c_destructor(struct c* this) {
}
int c_not_virtual(struct c* this) {
return this->data;
}
int c_im_virtual(struct c* this) {
return this->data - 1;
}
d->vtable.im_virtual(d);
struct c_vtable c_vtable = { c_im_virtual };
void c_constructor(struct c* this) {
this->vtable = &c_vtable;
}