How to pass two-dimensional array as an argument?

前端 未结 6 907
萌比男神i
萌比男神i 2020-12-14 23:47

My Matrx class is defined as

class Matrx
{
 double A[50][50];
 int m,n;
public:
 Matrx(void);
 Matrx(int a, int b)
 {
  m=a;
  n=b;
 }
 Matrx o         


        
6条回答
  •  轮回少年
    2020-12-15 00:21

    You need to specify all but the first dimension, e.g.

    void Matrx::readMatrx(double a[][50])
    

    From this you should be able to see that you have a fundamental problem with the way you have implemented your class, but at least you should now be able to get the code to compile.

提交回复
热议问题