I am reading from and xml document using c++.
[color="#8b0000"]<parent>
<child> 1 2 3 4 5 6 7 8 9 10 </child>
</parent>
I have already created the parser that will read in the numbers on that line and store them in a buffer.
when i [color="#8b0000"]cout<<buffer<<endl; that buffer I get the numbers with the spaces. how do i store them into an 2d array? ex: [color="#8b0000"]buffer[]={1,2,3,4,5,6,7,8,9,10};
right now the numbers are stored as a string buffer,
any ideas with the logic on how to do this would be awesome thanks
string buffer to 2d array
Generally XML is designed such that you don't need additional parsing on tag contents. That aside, you could fill a std::vector<int> by using a std::stringstream to re-parse the contents.
It won't be a 2d array, but I don't see how you're planning on building a 2d array from that data.
It won't be a 2d array, but I don't see how you're planning on building a 2d array from that data.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement