I am trying to create a basic airport system. I have some classes which are named in info, and all of those classes are very similar to the 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 I try to reach that "airports" array from another function which is from SystemManager class, it gives an error that "info::Airline airlines[100] is private", I think I am missing something with those operators.
if(info::airlines[counter].alname==aname
That is where compiler points as error, there is a counter for a loop in the function, and in that loop when it comes to this line, it gives error. How should I reach those classes?
By the way, I made those arrays static because I don't want them to be created with every airport has been created, I just want to keep airport informations in those arrays.
Thank you very much.