I have a problem with an array/pointer as an input parameter.
I want to use:
int A(int ncontours, int cntr[], double* vertices[], int *triangles [3])
{
...
B(n, nmonpoly, triangles);
...
}
A is defined in an h-file as:
extern int A(int, int *, double (*)[2], int (*)[3]);
B is defined as
extern int B(int, int, int (*)[3])
The error message is:
Error 1 error C2664: 'B' : cannot convert parameter 3 from 'int []' to 'int ()[3]'
I want to correct the input parameters of A to make them match the call of B.
I guess the problem is that it's a pointer to an array?
How can this be done?
Thanks!
int *triangles [3]andint(*)[3]are not the same, or wasn't the error message clear on that? The former is an array of pointers (as a param, the subscript is useless), the latter is a pointer to an array of threeint, and the subscript is very meaningful.int A(int ncontours, int cntr[], double* vertices[], int *triangles [3])is in the definition of the function, while the same function isexternasextern int A(int, int *, double (*)[2], int (*)[3]);. The decl ofAin the header doesn't match the definition ofAin he source file. They're not the same. Neither the vertices nor the triangles match by-type. Fix the definition to match the decl.