I have to read the data from finary file which is in the form std::vector<std::vector<std::vector<sphere_data> >> Sphere_image into std::vector<std::vector<std::vector<sphere_data> >> Sphere_image_read; Could any one help me how this can be read?
struct ss
{
int Cno;
int c_x;
int c_y;
};
std::vector<std::vector<std::vector<sphere_data> >> Sphere_image ;
std::vector<std::vector<sphere_data>> s_img;
std::vector<sphere_data> s_pixel;
I have written this sphere_image into a binary file like this:
ofstream fout("C:/Project/data.dat", ios::out | ios::binary);
for (constauto &dim: Sphere_image)
for (constauto &dim2:dim)
fout.write(reinterpret_cast<constchar*>(dim2.data()), dim2.size() * sizeof(sphere_data));