我想查找矩阵所具有的行数和列数,而无需知道任何其他事物。给定一个矩阵,找到行数和列数
例子:
int * findElements(int matInput[][]) {
/*Count blah*/
/*Now to run a loop till the number of rows*/
/*I need to know the size of the matrix to run the loop above*/
}
我不能运行一个循环来找到大小不知何时结束,也不知是否矩阵,同时创建初始化。 有没有其他方法?
嘛,有Java中的Array.length功能,但我不知道知道它是如何工作的。我猜想类似的东西可以在C中实现? – noMAD 2011-12-16 04:09:14