Last active
January 2, 2016 05:59
-
-
Save vermiculus/8260700 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Person_data { | |
int age; | |
char* name; | |
} | |
struct Person_data* __CLASS_PERSON__NEW ( void ) { | |
return malloc(sizeof(Person_data)); | |
} | |
void __CLASS_PERSON__DESTROY (struct Person_data *object) { | |
free(object); | |
} | |
void __CLASS_PERSON__SAY_HI (struct Person_data *object) { | |
printf("%s", object->name); | |
} | |
struct { | |
(struct Person_data*) new (void) = &__CLASS_PERSON__NEW; | |
(void) say_hi (struct Person_data*) = &__CLASS_PERSON__SAY_HI; | |
(void) destroy (struct Person_data*) = &__CLASS_PERSON__DESTROY; | |
} Person; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment