// print ints #include <iostream> #include <fstream> using namespace std; int main() { ofstream outfile("data.raw", ios::binary); for(int i =0; i < 10; ++i) { outfile.write(reinterpret_cast<char *> (&i),sizeof(i)); } outfile.close(); return 0; }