I have a problem with reading a binary file.
My code so far:
ifstream file("ns.bin", ios::in | ios::binary | ios::ate);
file.seekg(0, std::ios::end);
size = file.tellg();
file.seekg(0, std::ios::beg);
buffer = new char[size];
file.read(buffer, size);
file.close();
double* double_values = (double*)buffer;//reinterpret as doubles
My question is: How do I get the doubles from double_values
into a vector of this type:
vector<double> buffer2;
Or, if not possible: How do I get the number of doubles from double_values
?
Hope that sb can help me thanks !