I am now writing a code to do matrix calculation in Xcode4.3.
I could build and run the code below, but I always get the warning saying, ” Incompatible pointer types passing ‘float (*)[3][2]’ to parameter of type ‘float *’ ”
Can someone explain what that means and how I can avoid the warning?
float num1[3][2] = { {1,5},{2,6},{3,7} };
float num2[3][2] = { {2,2},{2,6},{3,3} };
float resA[3][2];
vDSP_vadd(&num1, 1, &num2, 1, &resA, 1, 6);
for (int i = 0; i<3; i++) {
for (int j = 0; j<2; j++) {
NSLog(@"resA[%d][%d]:%f",i,j,resA[i][j]);
}
}
Well, technically, an array is not a pointer, is only decays to a pointer.
If you want to avoid the warning, you can use: