Possible loss due to conversion from Multidimensional Array

 

I have written the loop and inside it there's sorting for multidimensional array but when compile it giving this error. How can i solve this?

double MyArray[][4];
int cnt=0;
int Jindex=0;

int start()
{

    ......

    for(int i=0; i<Limit; i++)
    {
        ArrayResize(MyArray, Limit);
        MyArray[cnt][0] = Close[i];
        MyArray[cnt][1] = i; // index of candle
        MyArray[cnt][2] = High[i];
        MyArray[cnt][3] = Low[i];
        cnt++;
    }

    ArraySort(MyArray, WHOLE_ARRAY, 0, MODE_DESCEND);
    
    for(int j=0; j<NumberOfClose; j++)
    {
        Jindex = MyArray[j][1]; // ===> the error came from this line

	....
    }
    return(0);
}
Any suggestion or work around to this? Thanks!
 
Panjianom Adi Pratomo:

I have written the loop and inside it there's sorting for multidimensional array but when compile it giving this error. How can i solve this?

Any suggestion or work around to this? Thanks!

Jindex is an int.

MyArray[][] holds a double.

You are trying to stuff a double into an int, and the compiler is warning you because it cannot know if that's really what you intended.

If that's what you really want, you have to typecast it.

Jindex = (int) MyArray[j][1];