ps做一寸照片教程视频:void Push_Stack(Elem x)/*入栈函数*/

来源:百度文库 编辑:高考问答 时间:2024/04/28 05:13:38
void Push_Stack(Elem x)/*入栈函数*/
{
if (IsFull()){printf("Stack is full,cannot push element!");exit(0);}
stack[top]=x;
top++;
} 这个函数是什么意思啊?有哪位好心人帮帮忙啊

函数作用:将一个单元存入栈中

if (IsFull()){printf("Stack is full,cannot push element!");exit(0);}
//判断该栈是否已满,满了则输出Stack is full,cannot push element!,并退出函数

stack[top]=x;
top++;
//将单元存入栈头,栈顶指针指向下一个,准备下一次入栈