Reading and writing binary file
If you want to do this the C++ way, do it like this: #include <fstream> #include <iterator> #include <algorithm> int main() { std::ifstream input( “C:\\Final.gif”, std::ios::binary ); std::ofstream output( “C:\\myfile.gif”, std::ios::binary ); std::copy( std::istreambuf_iterator<char>(input), std::istreambuf_iterator<char>( ), std::ostreambuf_iterator<char>(output)); } If you need that data in a buffer to modify it or something, do this: #include <fstream> … Read more