{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

03-ATDs - Ab Abstract Data Types Continuation This material...

Info icon This preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Ab t t D t T C ti ti Abstract Data Types Abstract Data Types – Continuation This material is based on contents of the book: “C Interfaces and Implementations”, from David R. Hanson. Parts also under permission from Princeton University. USF – COP4530 – Data Structures Summer 2009 1 of 45
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Include modules more than once What is key in this code? – Stack.h: #ifndef STACK_INCLUDED #define STACK_INCLUDED typedef struct Stack_T *Stack_T; extern Stack_T Stack_new (void); extern int Stack_empty(Stack_T stk); extern void Stack_push(Stack_T stk, void *x); extern void *Stack_pop(Stack_T stk); extern void Stack free(Stack T *stk); extern void Stack_free(Stack_T *stk); #endif Conditional compilation directives #ifdef and #endif and #define for STACK_INCLUDED permit stack.h to be included more than once Typical when interfaces import other interfaces USF – COP4530 – Data Structures Summer 2009 2 of 29
Image of page 2