Click on stack_with_delete.h to get source.
/* File: CExamples/OO_pgm_in_C_new/stack_with_delete.h */
/* This is the abstract data object; initialize by calling clone on an actual stack
(eg, see array_stack_without_new.c, main2.c)
remove by calling delete_stack */
typedef struct stackstruct
{ void *objptr; /* address of data structure */
/* abstract methods;
the actual data structure of the stack is accessed as self->objptr
In C++ self is the keyword this; self is from Smalltalk */
int (*is_empty)(struct stackstruct* self); /* returns 0 if *self is empty */
void(*push) (int, struct stackstruct* self);
int (*pop) (struct stackstruct* self);
/* object manipulation */
struct stackstruct* (*clone) (const struct stackstruct* self); /* make a copy */
void (*delete_stack) (struct stackstruct* self); /* delete object memory */
} stack, *stackptr;