string arrray initialization

samjesse

Active Trader
Aug 30, 2011
118
0
27
Hello

what is the correct way to do this?

many thx

MQL5:
class PAIRS
public:
   string names[2];
   PAIRS()
   {
      names("EURUSD","GBPUSD");
   }
 
   ~PAIRS(){}
   void get_pairs(void)
   {
      for(uchar i=0; i<ArraySize(names); i++)
      {
         Print(names[i]);
      }
   }
};

ps. what happened to the coding format on this site? I tried the new one but did not show formatting.
 
Last edited by a moderator: