类C语言–行编辑程序–算法与数据结构,完全可以实现,完整准确,下附有运行图片
代码区
#include<stdio.h>
#include<string.h>
#define MAXSIZE 100
typedef char SElemType;
typedef struct
{
SElemType Elem[MAXSIZE];
int top; //数值下标
}SqStack;
enum Status{
ERROR,OK};
//初始化栈,为空,栈顶指针置为-1
Status InitStack(SqStack &S)
{
S.top=-1;
return OK;
}
//判空操作,
Status StackEmpty(SqStack S)
{
if(S.top==-1)