[问题] 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