I have created a multidimensional dynamic array like this
int N;
cin >> N;
bool ** hap = new bool*[N];
for(int i = 0; i < N; i++)
hap[i] = new bool[N];
And It seems to work fine , But I need to pass this array to a function …
How should I do this?
Thanks
Pass it exactly as you declared it; as a bool **. Here’s a sample definition:
Then you can just call the function like so: