public
Created

  • Download Gist
stl-ex-2b.cpp
C++
1 2 3 4 5 6 7 8 9 10 11
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;
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.