>>897 続きです
/stack.c/
#include<stdio.h>
#include <stdlib.h>
#include <math.h>
#include"stack.h"
int main()
{}

void make_empty(Stack *s){
s->top = 0;}

int is_empty(const Stack *s){
return s->top == 0;}

int is_full(const Stack *s){
return s->top == STACK_SIZE;}

void push(Stack *s, int i){
if(is_full(s)) {puts("Overflow!");exit(EXIT_FAILURE);}
else s->contents[s->top++] = i; }

int pop(Stack *s){
if(is_empty(s)) {puts("Underflow!");exit(EXIT_FAILURE);}
else return s->contents[--(s->top)];}