In my program,I have to read the contents from a file(.map.xml) by line by line.
While I tried it by copying it to a CStringlist, the data got end on each spaces... But I have to read it on line by line.Is thr any way to trim it?
Plz get me code..
Printable View
In my program,I have to read the contents from a file(.map.xml) by line by line.
While I tried it by copying it to a CStringlist, the data got end on each spaces... But I have to read it on line by line.Is thr any way to trim it?
Plz get me code..
Why can't you just use Microsoft XML parser ?
Nop...
because, in my program-to add a new feature,I wanna take some parts of data from a xml file... Every time,when the program runs the xml file will not be same..So the user should download the xml file which he want to run. tats wy-as a programmer-I need this file to open and read..
So plz tell me a suit form to open n readthis xml file till end of line..(better I shd read line by line format)..... Help me plz.
Arun
I'm not sure what you want to do exactly.
You will eventually need to parse the xml code, wouldn't you?
But you can always use fread to read to a stream from a file.
for example:
You can also use this example to read file into a streamCode:result = fread (buffer,1,size,file);
http://www.cplusplus.com/reference/c...dio/fread.html
You still should use the Xml parser to read the file. After all, that's what an xml parser does - it reads xml. It really shouldn't matter what the xml contains because as long as it's valid xml, the parser is going to be able read it better than your hand written code.Quote:
Originally Posted by arunkr6