Haucher
2017-10-31 14:01这段代码能详解一下么??(很多c的知识没学好,数据结构里好懵逼)
typedef struct
{
ElemType data[MaxSize];
int top;
} SqStack;
void InitStack(SqStack *&s)
{
s=(SqStack *)malloc(sizeof(Sqstack));
s->top=-1;
}
void DestroyStack(SqStack *&s)
{
free(s);
}
bool Push(SqStack *&s,ElemType e)
{
if (s->top==MaxSize-1)
return false;
s->top++;
s->data[s->top]=e;
return true;
}
- 点赞
- 回答
- 收藏
- 复制链接分享
3条回答
为你推荐
- 求详解opencv中形状匹配matchShapes的代码参数及返回值!
- python
- 2个回答
- delphi 统计数据库里的数据到dbgrideh里显示,求方案?
- 开发语言
- 1个回答
- jqure的问题,对他不是很了解,不知道能不能像ajax一样获取action方法里面的参数。
- jqure
- 2个回答
- 求详解Spring MVC中的ResponseEntity?和ResponseBody又有啥区别
- spring
- web
- java
- 3个回答
- 服务和服务器是什么?详解
- 服务
- 服务器
- 9个回答
换一换