int型的stack结构
1 int型栈的实现
1.1 定义栈结构体
typedef struct tag_IntStack
{
int *elems;
int logicalLen;
int allocLen;
} IntStackTypeDef;
IntStackTypeDef S;
1.2 打印栈元素
void print_IntStack(IntStackTypeDef *s)
{
uint8_t i;
if(s->logicalLen == 0) {
printf("<NULL>\r\n");
}else{
for(i = 0; i < s->logicalLen; i++){
printf("elem[%d] = %d\r\n", i, s->elems[i]