How to pass double[][] into a method call?

后端 未结 3 926
温柔的废话
温柔的废话 2021-01-15 15:08

Hi I am trying to init an object with a double value in the format double filter[3][3]; but i keep getting the following error.

cannot convert \'double[3][3]\' to \'

3条回答
  •  独厮守ぢ
    2021-01-15 15:30

    you are passing as a parameter a double 2d array(double[][]) when your method signature asks for a double (a primitive like 34.2). set the method declaration to

    - (id)initWithMatrix:(double*) matrix;

    this passes a pointer to your array (2d) to the method. edit: missed a semicolon.

提交回复
热议问题