[問題] DEV C++ 執行 tinyxml 錯誤

看板C_and_CPP作者 (sony)時間8年前 (2015/12/23 15:46), 編輯推噓1(102)
留言3則, 1人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) DEV C++ 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) Tinyxml 問題(Question): 照下面教學網頁的load xml from a file 第二段程式碼執行發生錯誤 http://www.cs.cmu.edu/~preethi/src/tinyxml/docs/tutorial0.html PS : A more real-world usage is shown below. This will load the file and display the contents to STDOUT: 這行字下面的程式碼 餵入的資料(Input):預期的正確結果(Expected Output): 尚不知正確的結果為和 錯誤結果(Wrong Output): [Error] cannot convert 'TiXmlDocument*' to 'const char*' for argument '1' to 'void dump_to_stdout(const char*)' 程式碼(Code):(請善用置底文網頁, 記得排版) // load the named file and dump its structure to STDOUT void dump_to_stdout(const char* pFilename) { TiXmlDocument doc(pFilename); bool loadOkay = doc.LoadFile(); if (loadOkay) { printf("\n%s:\n", pFilename); dump_to_stdout( &doc ); // defined later in the tutorial } else { printf("Failed to load file \"%s\"\n", pFilename); } } 補充說明(Supplement): 感謝各位耐心看完,自學階段有很多不懂的地方,如有不足還請提醒,謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 60.248.80.45 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1450856782.A.94B.html

12/23 16:36, , 1F
英文註解已經說了 dump_to_stdout(TiXmlDocument*)
12/23 16:36, 1F

12/23 16:37, , 2F
後面才有定義,往下找Full listing for dump_to_stdout
12/23 16:37, 2F

12/23 16:38, , 3F
error訊息其實也告訴你發生什麼了
12/23 16:38, 3F
文章代碼(AID): #1MUb5EbB (C_and_CPP)