Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1921

 
int CommonArray[]={1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 13, 13, 13, 13, 13, 13, 13};
int ArrayI[20]=   {0, 0, 0, 0, 0, 0, 0, 8, 9, 10,  0, 12, 13, 13, 13, 13,  0,  0, 13,  0};
int ArrayJ[];

int CommonOffset=0; // или сколько надо

ArrayResize(ArrayJ,ArraySize(ArrayI));
int k=0;
for(int j=0; j<ArraySize(ArrayI); j++)
   if(ArrayI[j]!=CommonArray[j+CommonOffset])
      ArrayJ[k++]=CommonArray[j+CommonOffset];
ArrayResize(ArrayJ,k);

It's like this.

And the zeros are my fault, they should be there:

int k=0; // объявляем до цикла - чтобы использовать после
for(int i=0; i<ArraySize(ArrayI); i++) // после предыдущего кода (1) размеры ArrayI и ArrayJ равны
  if(ArrayI[i]!=ArrayJ[i])
    {
     -ArrayJ[k++]=ArrayI[i];
     +ArrayJ[k++]=ArrayJ[i];
    }
ArrayResize(ArrayJ,k);


 
Tretyakov Rostyslav #:

Hey

 
Tretyakov Rostyslav #:

Dear!

You are using the wrong information.

 
Vitaly Muzichenko #:

Dear!

You are using the wrong information.

Which one do you want?
 
Tretyakov Rostyslav #:
Which one do you want?

The other

 
Tretyakov Rostyslav #:
Which one is it?

You're a programmer, not a taxi driver, you need to look for the cause, not the effect, then everything will fall into place.

 
Vitaly Muzichenko #:

You are a programmer, not a taxi driver, you should be looking for the cause, not the effect, then everything will fall into place.

Tell us the cause. No conspiracy theories, please.

 
Andrey Sokolov #:

Tell us the reason why. No conspiracy theories, please.

Do you want to talk about it?

Then take it to a private message, or create a chat room. Just watch the video in my feed before you do so, so you don't ask too many questions.

 
Vitaly Muzichenko #:

Do you want to talk about it?

Then take it to your personal account, or create a chat room. Just watch the video in my feed before you do so, so you don't ask too many questions.

I'm sorry, but I don't discuss conspiracy theories, astrology, "higher powers" etc.

 
Andrey Sokolov #:

Sorry, but I don't discuss conspiracy theories, astrology, "higher powers" etc.

Well, clearly, you're 2,000 miles away.

Reason: