构建顺序栈问题,在线等!!
//不知道有什么问题,编译与连接都通过了,帮忙看看是什么问题...
#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include <iostream.h>
#define STACK_INCREAMENT 10
#define STACK_INTSIZE 100
typedef int selemtype;
typedef struct Snode
{
selemtype *base;
selemtype *top;
int stacksize;
}Snode, *Slink;
void Init_stack(Slink &s)
{
s->base = (selemtype *)malloc(STACK_INTSIZE * sizeof(selemtype));
if( !s->base )
{
printf(" the overflow error in Init_stack\n ");
exit(1);
}
s->stacksize = STACK_INTSIZE;
s->top = s->base;
}
void main()
{
Slink s = NULL;
Init_stack( s );
}