C++动态分配内存和释放
Supposewehaveavariale:double**Matrix;Writetwofunctions:double**allocMatrix(intn);void...
Suppose we have a variale:
double **Matrix;
Write two functions:
double **allocMatrix(int n);
void releaseMatrix(double **m);
Function allocMatrix(n) will allocate memory space from heap to store a matrix with the scale n*n, while function releaseMatrix(m) will return the memory space used by m to heap. 展开
double **Matrix;
Write two functions:
double **allocMatrix(int n);
void releaseMatrix(double **m);
Function allocMatrix(n) will allocate memory space from heap to store a matrix with the scale n*n, while function releaseMatrix(m) will return the memory space used by m to heap. 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询