#include <iostream>
#include <fstream>
using std::cout;
using std::endl;
using std::ifstream;
int main()
{
ifstream file("d:\\data.bin", std::ios::in | std::ios::binary | std::ios::ate);
if (file.is_open()) {
int pos = file.tellg();
char *buf = new char[pos + 1];
file.seekg(0, std::ios::beg);
file.read(buf, pos);
file.close();
buf[pos] = NULL;
cout << buf << endl;
delete[] buf;
}
else
cout << "Error open file" << endl;
return 0;
}
/*
run:
├⌡H@∞╤»BתשM┴
*/