Advertisement
Guest User

oodmain

a guest
May 15th, 2012
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.03 KB | None | 0 0
  1. /*-
  2.  * Copyright (c) 2012 valsorym <[email protected]>.
  3.  * All rights reserved.
  4.  *
  5.  * Discussion on the forums.freebsd.org.
  6.  *  url: http://forums.freebsd.org/showthread.php?p=177208
  7.  */
  8.  
  9. #include <stdio.h>
  10. #include "objectmode.h"
  11. #include "human.h"
  12.  
  13. int
  14. main(int argc, char **argv)
  15. {
  16.     w_human *manager = (w_human *)new((w_class *)i_human, 32, "Jim K."),
  17.             *secretary = (w_human *)new((w_class *)i_human, 32, "Sara M.");
  18.    
  19.     printf("Manager.\n\tAge: %d.\n\tName: %s.\n",
  20.         manager->age, manager->name);
  21.        
  22.     printf("Secretary.\n\tAge: %d.\n\tName: %s.\n",
  23.         secretary->age, secretary->name);
  24.        
  25.     /* Dismiss an old manager, and hire a beautiful brunette. ;) */
  26.     manager->set_age(manager, 21);
  27.     manager->set_name(manager, "Dasha N.");
  28.    
  29.     printf("\nNew peaople.\n");
  30.     printf("Manager.\n\tAge: %d.\n\tName: %s.\n",
  31.         manager->age, manager->name);
  32.            
  33.     delete(manager);
  34.     delete(secretary);
  35.    
  36.     return 0;
  37. }
  38.  
  39. /* The End. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement