Download MetaTrader 5

Code generation error when passing arguments by reference

To add comments, please log in or register
How to buy a product in MetaTrader AppStore? Read the article!
mfdesire
6
mfdesire 2010.11.16 22:51 

Hi all,

Here is a piece of code, generating a 'code generation error' compilation error.

class A
{
   public:
      virtual int doSomething(
                     const int& elementsCount,
                        double& arrData[]
                                      )
      {
         return 0;
      }
};

A* g_pA;

int OnInit()
{

   g_pA = new A();
   int elementsCount = 1;
   double arrTemp[ 1 ];
   g_pA.doSomething(
            elementsCount,
            arrTemp
                   );
   return(0);
}

void OnDeinit(const int reason)
{
   delete g_pA;
}

void OnTick()
{
}

Does anybody have any clue what is the compiler's problem?

 

Thanks in advance,

Maxim

Alexey Da
Moderator
6604
Alexey Da 2010.11.17 09:56  

Thank you for your message.

Bug was fixed, wait for new build.

To add comments, please log in or register