我有一个在互联网上发现的问题,但它没有最好的解决方案。我的问题是我有一个二维矩阵,我想在第 i 个位置删除一列。例如,矩阵可以表示为 A[2][3]={1,2,3,4,5,6}。我想删除位置 2 的列。所以输出是 B={1,3,4,6}。你能帮我吗?
A=[1 2 3
4 5 6]
输出
B=[1 3
4 6]
功能是
int** delete_column(int** inputMatrix,int position)
{
//The size of outMatrix must be smaller than inputMatrix
return outMatrix;
}