C++ Passing a dynamicly allocated 2D array by reference
问题 This question builds off of a previously asked question: Pass by reference multidimensional array with known size I have been trying to figure out how to get my functions to play nicely with 2d array references. A simplified version of my code is: unsigned int ** initialize_BMP_array(int height, int width) { unsigned int ** bmparray; bmparray = (unsigned int **)malloc(height * sizeof(unsigned int *)); for (int i = 0; i < height; i++) { bmparray[i] = (unsigned int *)malloc(width * sizeof