Reading a large text file

Hi there,

I'm working on my final year project at the moment and for it I need to parse really large XML files. My question is when I read in this file is it ok to store it in a string object? the test file I'm working on at the moment is 18,000 lines with an average of 20 characters per line so it is a massive amount of data. Is there any other object I should store it in instead of a string or is that fine? will I ever run out of memory when the files are bigger than that? thanks for your help.
18000 * 21 bytes is just 370 kB so I don't think you will have any problems storing the whole file in a std::string.
Last edited on
Thanks Peter87, I'm just curious in case there is a technical limitation to addressing each character in the string, I'm not adding to or taking away from the string but merely pointing to specific nodes within the xml and retrieving the element within the node.
Topic archived. No new replies allowed.