void push(char name, int key)
{
Node *character = NULL;
character->link = tos;
name = character->data;
key = character->precedence;
push(character);
};
我的我的兩個例外:不斷收到處理錯誤。導致我的計劃,以打破
First-chance exception at 0x011460C2 in Program Assignment 2new.exe: 0xC0000005: Access violation writing location 0x00000008.
Unhandled exception at 0x011460C2 in Program Assignment 2new.exe: 0xC0000005: Access violation writing location 0x00000008.
而且tos
早在我的代碼已經定義一個指針。
您正在聲明一個指針,並將其賦值爲NULL,然後立即對其進行解引用。你想在這裏做什麼?沒有看到您的其他代碼很難說。 – 2014-10-29 20:37:06
push(char,int):創建一個新節點並將其放置在TOS(堆棧頂部)上,您將需要爲char和int參數提供變量 – 2014-10-29 20:46:11