This sounds easy and I've seen questions about this being answered by using a vector instead but I can't do that in my case so asking for help...
What should be my function signature for return2dArray() if I want to do this? Please note that I cannot use a vector. It really has to be int[][]. Thanks!
int* return2dArray()
{
static int a[2][2] = {{1, 2}, {4, 5}};
return a;
}
int main()
{
auto x = return2dArray();
for (int y = 0; y < 3 ; y++)
{
std::cout << "y is = " << x[y] <<std::endl;
}
}