how to create five dimensional array ?

 
double array[10][9][8][7][6];   // this is giving me an error:
                                // '[' - wrong dimension

double array[10][9][8][7];      // this is working normally
 
You cant go above 4 dimensions unfortunately
 
Lorentzos Roussos:
You cant go above 4 dimensions unfortunately

thank you, but there must be a trick, like putting two multidimensional arrays together


 
Samih Abdelli:

thank you, but there must be a trick, like putting two multidimensional arrays together


You can merge the [6][7] as [42] 

 
Lorentzos Roussos:

You can merge the [6][7] as [42] 

yes, thank you, I found a way to solve my prob just with 4 dimensions array 

 

Maybe you can build  a 4-dimensional array of vectors. There's no standard class for vectors but in MQL5 there's CArrayDouble.

Initialisation would be as follows:

#include <Arrays/ArrayDouble.mqh>

CArrayDouble array[10][9][8][7];

void init() {
  for(int i=0;i<10;i++)
    for(int j=0;j<9;j++)
      for(int k=0;k<8;k++)
        for(int l=0;l<7;l++) {
          array[i][j][k][l].Resize(6);
          array[i][j][k][l].Insert(3.14,0);
          array[i][j][k][l].Insert(1.07,5);
        }
}
 
lippmaje:

Maybe you can build  a 4-dimensional array of vectors. There's no standard class for vectors but in MQL5 there's CArrayDouble.

Initialisation would be as follows:

thank you but Im using MQL4

 
Samih Abdelli:

thank you but Im using MQL4

Should work in MQL4 as well - ArrayDouble.mqh is also part of standard library available in MQL4.