0

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.

karakanb
  • 37
  • 5
  • Should work. Sorry cant answer the question. If I was you, I would simply write public member functions to allow access to the `airports` array – The Vivandiere Mar 28 '15 at 21:46
  • This was the only way I could think of, and I built the whole program with this logic, and now it gives me hundreds of same error for some other private members same as this one, if I can solve this, the code will work properly I hope. – karakanb Mar 28 '15 at 22:12

0 Answers0