Getting Segmentation Fault with TinyXML

C9H13NO3

New Member
I currently have an XML file which I'm parsing using TinyXML. The top of my XML file look as so :\[code\]<Classroom>12 <ClassName>name</ClassName> ...</Classroom>\[/code\]I'm attempting to access the text in ClassName. I am currently getting a segmentation fault using this:\[code\]TiXmlDocument doc;doc.LoadFile(file);TiXmlHandle handle(&doc);TiXmlElement * child = handle.FirstChild().FirstChild().ToElement();cout<<child->GetText();\[/code\]What am I doing wrong?Thanks!
 
Back
Top