1. 首页
  2. 编程语言
  3. C++ 
  4. 栈表的操作

栈表的操作

上传者: 2020-09-14 15:49:20上传 C文件 1.44KB 热度 45次
//top为整数,代表栈顶元素位置 #include #include #define MAXNUM 50 typedef int Elemtype; typedef struct { Elemtype stack[MAXNUM]; int top; }SqStack; //栈的初始化 int InitStack(SqStack *s) { Elemtype *p; p=s->stack; p=(Elemtype *)malloc(MAXNUM*sizeof(Elemtype)); if(!p) return 0; s->top=-1;
下载地址
用户评论