Here is data structure w/ variables:
struct Part_record
{
char id_no[3];
int qoh;
string desc;
double price:
};
---
(Using "cin" to input data)
---
Part_record null_part = {" ", 0," ",0.0};
---
---
file.seekg( -(long)sizeof(Part_record), ios::cur);
file.write( ( char *)&part, sizeof(Part_record) );
The three variables, qoh, Id_no & price, write out correctly, but the "desc"
variable is not right.
Do I need to initialize Part_record some other way? It should be 20 characters in length.
If you have enough info here, pls share your advice,thanks.