迷宫图
data.h
#ifndef _DATA_H
#define _DATA_H
typedef struct
{
int y;
int x;
}POS;
typedef struct
{
int sno;
POS seat;
int di;
}ElemType;
#endif
stack.h
#ifndef _STACK_H
#define _STACK_H
#include "data.h"
#define STACK_INIT_SIZE 10
#define STACK_INCREME 10
typedef struct
{
ElemType * base;
ElemType *top;
int size;
}STACK;
STACK * InitStack();
void DestroyStack(STACK *s);
int Push(STACK *s,ElemType *e);
int Pop(STACK *s,ElemType *e);
int IsEmpty(STACK *s);
#endif
stack.c
#include "stack.h"
#include <stdio.h>
#include <stdlib.h>
STACK * InitStack()
{
STACK * s = (STACK *)malloc(sizeof(STACK));
if(s == NULL)
exit(0);
s->base = (ElemType *)malloc(STACK_INIT_SIZE