How do I access elements of a two dimensional array, using a pointer to that array?
std::recursive_mutex *(*A)[2];
std::recursive_mutex *B[2];
B[0] = new std::recursive_mutex[some_size];
B[1] = new std::recursive_mutex[some_size];
A = &B;
//accessing
//A[0][0]
//A[1]
//A[1][0]
//will not work (since the pointers do not point to the same locations as
//B[0][0]
//B[1]
//B[1][0]
Bonus question: is there a nicer way to initialize A? (without using std::vector)