c++ - Reading XML: How to catch exceptions from ticpp::LoadFile()? -


i trying read xml file using ticpp::loadfile(); not successfull , did not know why because have no idea how catch exceptions. here did:

try {     // load document     ticpp::document doc( pfilename );     doc.loadfile();      // element chaining calls - no return values check, no tixmlhandle     ticpp::element* pelem = doc.firstchildelement()->nextsibling();      // useful here } catch( ticpp::exception& ex ) {     // if function has error, execution enter here.     // report error     std::cout << ex.what(); } 

but ex shows grayed if never declared. wondering how can catch exceptions in case?

it turned out file path messed up. code fine.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -