Skip to content

Instantly share code, notes, and snippets.

@berkeley-db
Created January 24, 2011 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berkeley-db/794032 to your computer and use it in GitHub Desktop.
Save berkeley-db/794032 to your computer and use it in GitHub Desktop.
typedef std::map<const char *, Car> owner_car_map_t;
owner_car_map_t ocmap;
while (has more owner-car pairs to input) {
// Accept input data for owner name and car, create car.
cin>>owner>>len>>width>>height>>hp>>ncyl>>displ;
Engine *pEngine = new Engine(hp, ncyl, displ);
Car car(len, width, height, pEngine);
ocmap[owner.c_str()] = car;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment