I have a library that defines a function as follows:
int MAG_robustReadMagModels(char *filename, MAGtype_MagneticModel *(*magneticmodels)[], int array_size)
The library was written in C. I am attempting to use it in C++ like this:
MAGtype_MagneticModel* Models[1];
MAG_robustReadMagModels(filePathNative, &Models, 1);
Which is the way it is used in the example programs. However I get the message
Error C2664 'int MAG_robustReadMagModels(char *,MAGtype_MagneticModel *(*)[],int)': cannot convert argument 2 from 'MAGtype_MagneticModel *(*)[1]' to 'MAGtype_MagneticModel *(*)[]'
Both when I attempt to compile it and during code-time.
furthermore, i have not been able to dynamically allocate an unsized array or cast a double pointer to the required type of *(*)[]
I'm guessing this is a language incompatibility between C and C++. How do I get around this?