This question isn't meant to sound as blatantly insulting as it probably is right now.
This is a homework assignment, and the spec sheet is scarce and poorly designed to say the least. We have a function:
double refuel( int liter, GasStation *gs )
// TODO: Access private variable MaxFuel of gs and decrement.
setFuel( int liter )
Now that sounds like a real lousy homework assignment.
Anyway, I can think of three ways to access private data:
friendof the class
#define private public #include "the_class.h" #undef private
The first two are legal, but require you to change the class. The last is "non-intrusive" (for some definition of "non-intrusive", anyway), but is definitely illegal (although I have yet to see a compiler were it wouldn't work).