Reading and writing to an excel file.

Pages: 12
Sorry I've got no idea whatcha mean there mate sorry.
Like, for example:

1
2
3
4
5
  case 5:
    cout << "Enter how many miles per gallon your car does: " << endl;
    cin >> car_mpg;
    cl.setMPG(car_mpg); // Add this type of thing to each of the cases
    break;


to update the object. As at the moment you're not giving it any data.
How was I giving it data before the switch statement then?
I assume where you took input was before the point you created the instance of the object.
It worked! Thanks a lot Pax!

Just trying to figure out *why* it works now.
Because when you were saving out to the file, you were taking the value from the "Car" object - which was initialised with variables containing no data. Changing the variables that you used to initialise the car object doesn't make a difference, because the object has made a local copy of them which it maintains itself and doesn't keep in sync with the variables you passed to it.

I don't know if I've explained that very well. :/
Topic archived. No new replies allowed.
Pages: 12