-
-
Save ibeauregard/14edaf65482d7e20a4c2ec9ce676e081 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* int_stack.c */ | |
#include "int_stack.h" | |
static void push(IntStack* this, int value); // function declarations | |
static int pop(IntStack* this); | |
static int peek(IntStack* this); | |
static bool is_empty(IntStack* this); | |
static void delete(IntStack** this); | |
IntStack* new_stack() | |
{ | |
IntStack* this = malloc(sizeof (IntStack)); | |
this->top = NULL; | |
this->push = &push; | |
this->pop = &pop; | |
this->peek = &peek; | |
this->isEmpty = &is_empty; | |
this->delete = &delete; | |
return this; | |
} | |
// struct int_node definition | |
// Function definitions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment