#include <iostream>
#include <fstream>
using std::cout;
using std::endl;
using std::ofstream;
#define SIZE 5
int main()
{
int arr[SIZE] = { 45, 8, 12, 98, 875 };
ofstream ofs("d:\\data.bin", std::ios::binary);
ofs.write(reinterpret_cast<char*>(arr), SIZE * sizeof(int));
ofs.close();
return 0;
}
/*
run:
data.bin
--------
- b k
*/