请帮助下面的段。当n从堆栈的顶部移除,堆栈是空的,输出应该是“-1弹出的”。(我越来越0 ATM)堆栈执行输出
void pop(void) {
struct node *temp;
int n;
if (top == NULL) {
printf("%d popped\n", top);
return;
}
n = top->item;
temp = top;
top = top->prev;
free(temp);
printf("%d popped\n", n);
return;
}
为什么使用'printf'格式访问一个常量? – 2012-08-10 10:26:54
按照要求应答..;) – perilbrain 2012-08-10 10:29:46