Home > Back-end > The question of structure written to the binary file
The question of structure written to the binary file
Time:12-05
Struct Test2 { Int index; } Struct Test1 { int id; Vector}; Original intention is to want to put the Test1 this structure written to the binary file Read write without error, but when looking at the data is wrong in the stack vecTest2 Is it time can't use the vector storage structure? But I must keep a dynamic array, how can I solve???????
CodePudding user response:
Low-level file can be not only 01 binary string structure, how to write read need you to confirm the format, such as the length of the vector can be written in, and then read how many test1 according to determine the length of the read read