The easiest way to create binary files is to use fixed-length character arrays instead of std::string. That will make each of the records in the binary fine the same size and you can easily locate any record in the file by simply multiplying the record number times record size.
struct record
{
char make[40];
char model[40];
char color[20];
int year;
int mileage;
};
ofstream out("filename.bin", ios::binary);
struct record r[3];
// write three cars
out.write( (char*)r, sizeof(struct record) * 3);
// read 3 cars
ifstream in("filename.bin", ios::binary);
in.read( (char *)r, sizeof(struct record) * 3);