Sep 12, 2011 at 9:36pm UTC
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 Sep 12, 2011 at 11:47pm UTC
Sep 12, 2011 at 11:09pm UTC
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 Sep 12, 2011 at 11:09pm UTC
Sep 12, 2011 at 11:17pm UTC
This is the class definition:
Last edited on Sep 12, 2011 at 11:47pm UTC
Sep 12, 2011 at 11:21pm UTC
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
Sep 12, 2011 at 11:26pm UTC
I see, I missed that. Thanks Disch.
Sep 12, 2011 at 11:28pm UTC
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 Sep 12, 2011 at 11:28pm UTC