Engaged in the study of the benefits after three years of Java (Android) Dynamic memory allocation
int N = 2; int **M = (int **) malloc(N * sizeof(int)); for (int i = 0; i < N; i++) { M[i] = (int *) malloc(N * sizeof(int)); } After this creation, I get an array of pointers M, in which the debager (in CLion) returns an infinite number of elements. And each of the elements contains an infinite number of intes. More precisely, pointers to them Explain, please, what is the number of elements? From the value of N, the number does not change. Are these pointers to memory outside of arrays?
std::vectorandstd::array. - Vladimir Gamalyan