Hello,
I want to write a function which returns a multidimensional array of bools. I gather that you cannot return an array in C++, but you can return a pointer to array. I have tried this, and it works fine when my array has a single dimension - but I want it to have two dimensions.
However, when I compile this, I get the following error:Code:bool** myFunction(bool myArray[5][10]) { // Do some stuff to myArray bool** myPointer; myPointer = myArray; return myPointer; }
"error C2440: 'initializing' : cannot convert from 'bool [5][10]' to 'bool **"
Please can anyone show me how I can return this pointer in the correct manner?
Thanks