arrays - C++ Accessing a class' private member from another friend class' function -
i trying create basic airport system. have classes named in info, , of classes similar airport class.
class airport{ private: friend class systemmanager; friend class info; string apname; }; class info{ private: friend class systemmanager; static airport airports[100]; static airline airlines[100]; static flight flights[100]; static flightsection sections[100]; static seat seats[100]; };
now, when try reach "airports" array function systemmanager class, gives error "info::airline airlines[100] private", think missing operators.
if(info::airlines[counter].alname==aname
that compiler points error, there counter loop in function, , in loop when comes line, gives error. how should reach classes?
by way, made arrays static because don't want them created every airport has been created, want keep airport informations in arrays.
thank much.
Comments
Post a Comment