I have:
char cubesA[100][100][100];
char cubesB[30][30][30];
how can I pass them as a parameter to access them using the three square brackets[][][] inside a fuction?
void function( char cubes[][a][b] )
{
//---
}
I have:
char cubesA[100][100][100];
char cubesB[30][30][30];
how can I pass them as a parameter to access them using the three square brackets[][][] inside a fuction?
void function( char cubes[][a][b] )
{
//---
}
how can I pass them as a parameter to access them using the three square brackets[][][] inside a fuction?
template <typename T, size_t N, size_t M>
void foo(T(&cubes)[N][M]) {
// you can access `cubes` like you'd expect, sizeof works, etc.
};
int main() {
char test[10][20];
foo(test); // deduces to foo<char, 10, 20>(test);
}
Hi.
Try function(char ***ar, DWORD size1, DWORD size2, DWORD size3)
What are you trying to do?
Often times when your program calls for a multidimensional array it's better to put that array in an object that better restricts legal operations on the array. So instead of passing around an array, you would pass around an object that internally used an array in it's implementation.