Hello all,
I am reading a file and I want to read it into a buffer using fstream. anyone have any sample code to read and write files into a buffer?
Thanks!
Printable View
Hello all,
I am reading a file and I want to read it into a buffer using fstream. anyone have any sample code to read and write files into a buffer?
Thanks!
1) what type of buffer (string , char [])
2) do you want to read the entire file into memory at once ?
3) here is a link for sample code ...
http://www.nicoletti.50megs.com/cpp_...s/reading.html
I am using string's so that would work.. I just want to read part of the file into memory.. kind of like in C how you would parse a comment like this:
/* blah blah blah */
So I want to read when I encounter the "/*" and then read until I encounter the "*/"
Later I want to write that comment back to another file
Thanks!
Do you have any simple sample code for what I asked? I didnt understand the example in the link you posted :(
[ moved thread ]