I'm trying to make a function which will make generalized outer product of two arrays in a way that creates dynamically allocated 2D array (matrix). The types of the first two parameters must be identical to the types of the next two parameters, but the types of the first two parameters do not have to be identical to the types of the next two parameters (eg the first two parameters can be pointers to deck of integers). This also implies that the elements of these two arrays do not necessarily have to be of the same type. As for the function