because of the beeps that play. The program closes after playing the first beep. Anybody know why the program exits at this point? Or at least a way to fix this?
You look for your first flag as a child of the root element instead of the current event element, so as you don't specifity a node name in FirstChildelement, it returns you the events node and not a flag node.
As you have the wrong node type, the Attributes() will return NULL, and string crashes crashes when constructed with a NULL char* as argument.
If you pass STL strings to tinyxml, compile tinyxml with STL string support, it will remove the need for c_str() at line 5 for exemple