467,886 Members | 1,774 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,886 developers. It's quick & easy.

TinyXML and std::vector

Hi,

I'm trying to store some elements of TinyXml in a 2d std::vector

here is my code
#include "stdafx.h"
#include "tinyxml.h"
#include <vector>

void write_simple( )
{

TiXmlDocument doc;
TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "", "" );
doc.LinkEndChild( decl );

std::vector<std::vector<TiXmlElement*>element;
element.push_back(std::vector<TiXmlElement*>(2));
element[0].push_back( new TiXmlElement( "Objet1" ));
/*TiXmlElement * param1 = new TiXmlElement( "Param1" );
element[0].push_back(param1);
element[0][0]->LinkEndChild( element[0][1]);*/

doc.LinkEndChild( element[0][0] );

doc.SaveFile( "madeByHand3.xml" );
}

int main(int argc, char* argv[])
{

write_simple();
return 0;
}

May 1 '07 #1
  • viewed: 1584
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

18 posts views Thread by Janina Kramer | last post: by
17 posts views Thread by Michael Hopkins | last post: by
8 posts views Thread by Ross A. Finlayson | last post: by
32 posts views Thread by zl2k | last post: by
56 posts views Thread by Peter Olcott | last post: by
9 posts views Thread by aaragon | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.