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

作者: sony721121 (sony)   2015-12-23 15:46:17
開發平台(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):
感謝各位耐心看完,自學階段有很多不懂的地方,如有不足還請提醒,謝謝!
作者: BlazarArc (Midnight Sun)   2015-12-23 16:36:00
英文註解已經說了 dump_to_stdout(TiXmlDocument*)後面才有定義,往下找Full listing for dump_to_stdouterror訊息其實也告訴你發生什麼了

Links booklink

Contact Us: admin [ a t ] ucptt.com