On Thu, 07 Jul 2005 13:37:40 GMT, "JariTapio" <Ja*******@pp.inet.fi>
wrote:
Hei!
How to load data file example "File.Dat" from my homepage with c++ or Visual
c++
program to my "unsigned char g_MyData[256]"..
What commands do i need to use and will the code be very long ??
I have Visual Studio 6.0 Students Pro.
Yours : JT.
Check out the std::fstream and std::istream classes. You will need to
open the file with the std::ios_base::binary flag, then you can call
the read function as many times as you need giving it the pointer to
your array and size of 256 bytes to read. The last time around, eof()
will return true and fewer than 256 bytes will have been read (hint:
you'll have to use one or more of the other member functions to
determine how many bytes were read the last time).
It's all in MSDN under "VC++/Reference/c++ Language/STL" or some
similar path.
--
Bob Hairgrove
No**********@Home.com