I really need your help. I have the following structs in my code:
struct Field{
char name[20];
int type;
int length;
};
I used c-like sentence to process. The key is you just need to find the address of the first vec data, than use adjacent buffer to write them in files.
bool storeStructVec(FILE *fpOut, const vector &vec)
{
unsigned int nSize = vec.size();
if (nSize != fwrite(&vec[0],sizeof(Field),nSize,fpOut))
return false;
else return true;
}