Hi, I have a binary image (128x128x64x8) in float (4 byte). I am trying to read it into a vector w/ fstream. The program appears to open and read the file correctly, but the values displayed are not correct, so I assume I am somehow reading the file incorrectly. The implementation is shown below, any help would be greatly appreciated
Code:void float_Image::read(const char* file_name){ ifstream in; in.open(file_name,ios::binary|ios::in); if(in.is_open()) cout<<"reading..."<<endl; else cout<<"file not opened successfully"<<endl; float num; for (unsigned int i=0;i<x_*y_*z_*f_;++i){ in>>num; binary_data_.push_back(num); } }