Hi,
Im trying to write the vector product to a file but im havin no luck this has worked for other objects in the past.
Thanks
Code:vector<product_structure> product; ofstream fout(filename,ios_base::binary); if (!fout.is_open()) { return false; } fout.write(reinterpret_cast<char*>(product),product.size * sizeof(product_structure)); fout.close(); c:\Documents and Settings\Administrator\Desktop\iBurn\cMain.h(53): error C2440: 'reinterpret_cast' : cannot convert from 'std::vector<_Ty,_Ax>' to 'char *' with [ _Ty=product_structure, _Ax=std::allocator<product_structure> ]




Reply With Quote