I\'m attempting a simple test of binary file I/O using the STL copy algorithm to copy data to/from containers and a binary file. See below:
1 #include
For the question 1) You need to specify a separator (for example a space). The non-decimal part was stuck to the decimal part of the previous number. Casting and using NULL is generally wrong in C++. Should have been a hint ;)
copy (vd.begin(), vd.end(), oi_t(output, " "));
For the question 2)
#include
output << setprecision(9);