Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*-
- * Copyright (c) 2012 valsorym <[email protected]>.
- * All rights reserved.
- *
- * Discussion on the forums.freebsd.org.
- * url: http://forums.freebsd.org/showthread.php?p=177208
- */
- /*
- * Very simple class, for example OOD in ANSI C.
- */
- /* NEW TYPES */
- /* ************************************************************************* */
- #ifndef HUMAN_H
- #define HUMAN_H
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- /* Сlass of persons. */
- struct w_human {
- /* Private: */
- int age;
- char *name;
- /* Public: */
- int (*setage)(struct w_human *, int );
- int (*getage)(struct w_human *);
- char *(*setname)(struct w_human *, char *);
- char *(*getname)(struct w_human *);
- };
- /* Class initializer. */
- extern const struct w_human_initializer {
- struct w_human *(*create)(int , char *);
- void (*destroy)(struct w_human *);
- } w_human;
- #endif
- /* The End. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement