int java declaration of array like this
int a[][]=new int[3][3] works but in c++ not why? please help me i have not used c++ a long time so please help me
int java declaration of array like this int a[][]=new int[3][3] works but in c++
Share
I once had this same problem and ended up creating a class for it. Basically it’s stored as a pointer of single dimension array and the pointers are manipulated a bit so that it acts just like a 2D array (matrix). Here’s the code I used:
Usage would be like:
You can also extend this class so that it has other matrix related function in it.