public Student(int rows, int cols, double[] value) { numRows = rows; numColumns = cols; Init(numColumns, numRows); SetData(value); } public Student(int nSize, double[] value) { Student(nSize, nSize, value); //错误 6 “ConsoleMatrix.Student”是“类型”,但此处被当做“变量”来使用 } 难道不能调用吗?
=====================================================================================================================
能的,不过不能像是普通函数那样调用,只能当作继承来调用。如下: public Student(int rows, int cols, double[] value) { numRows = rows; numColumns = cols; Init(numColumns, numRows); SetData(value); } public Student(int nSize, double[] value):this(nSize,nSize,value) { //Student( int nSize,int nSize,double[] value); //错误 6 “ConsoleMatrix.Student”是“类型”,但此处被当做“变量”来使用 }