Advertisement
Guest User

Untitled

a guest
Oct 20th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. class(Foo)
  2.         method(void, foo, char *text)
  3.         {
  4.                 printf("%s%c\n", text, self->ending);
  5.         }
  6.         instance_variable(ending);
  7. end()
  8.  
  9. Foo *newFoo()
  10. {
  11.         Foo *foo = (Foo*)malloc(sizeof(Foo));
  12.         return foo;
  13. }
  14.  
  15. int main()
  16. {
  17.         Foo *foo = new(Foo);
  18.         foo->ending = '!';
  19.         $(foo, foo);
  20.         return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement