当我尝试为代码中的矩阵释放分配的内存时遇到问题。我正在使用这个功能:
void free_matrix(float **m, int row)
{
for( int i=0; i<row; i++ )
{
free( m[i]);
}
free(m);
}
但我不知道为什么它不起作用,我得到这个错误:
Windows has triggered a breakpoint in mycode.exe.
This may be due to a corruption of the heap, which indicates a bug in mycode.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while mycode.exe has focus.