看板 C_and_CPP 關於我們 聯絡資訊
開發平台(Platform): (Ex: Win10, Linux, ...) Win10 編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出) VC2015 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) none 問題(Question): 設計方法是利用Node物件 包含一個紀錄值(int) 及 指向下個 Node 的 Node*指標 Node有Get 及設定下一個節點的方法。 在List中InsertNode裡面使用LinkedNode無法有效連接下一節點。 餵入的資料(Input): Node pNode(1); Node pNode2(2); Node pNode3(3); 預期的正確結果(Expected Output): 1 2 3 錯誤結果(Wrong Output): nullptr 程式碼(Code):(請善用置底文網頁, 記得排版) https://github.com/CJayKao/LinkedList- 補充說明(Supplement): 卡在無法把Node中*Node nextNode無法指向正確節點。 感謝PTT板友 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.172.107.136 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1507401885.A.CBE.html
kaneson: pRNode=fistNode->next 得到null後又對pRNode做物件操作 10/08 03:51
kaneson: 就會跳error了 10/08 03:51
smartjay: 感謝 新增一個確認 下一節點為空的方法,再將專案做修 10/08 20:03
smartjay: 正 10/08 20:03