What's wrong with this?

I'm getting some errors in the following function:
[code[/code]

Here are the errors:


What's wrong here? I can post more information if I need to. Thank you.
Last edited on
You might be better off posting your full code or at least all relevant parts e.g. includes, class definition, main(), etc as it's a little difficult to help based on this.
Last edited on
This is the class definition:
Last edited on
You're trying to access private members (airline, flightNum) from a function that is not part of the Flight class.

Instead, you should use your accessor functions, get_airline, get_flightNum
I see, I missed that. Thanks Disch.
FWIW, you should have been able to diagnose that on your own. One of the errors basically said exactly the same thing I did:


Flight.h:14: error: 'int Flight::flightNum' is private
flightUtil.cpp:118: error: within this context


Learning to read and understand error messages is an important skill! ;)

But glad I could help.
Last edited on
Topic archived. No new replies allowed.