請幫助下面的段。當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