T
Thomas Hede Jensen
Hi,
I'm currently working on a project in which I link to a library where the
function definitions takes parameters of the type: "const int *const
*paramName"
As far as I can tell from the example of usage this type definition requires
a const int array, however, I do not know the size of those arrays at
compile time (due to the nature of other parts of my code), thus I have to
dynamically allocate the arrays by using "new". Passing parameters of this
type results in the compiler error:
'Create' : none of the 4 overloads can convert parameter 3 from type 'int *'
I have tried type casting or reinterpret_cast, none of which works, also I
tried passing the parameters as "**int", this compiles, but this throws an
exception at runtime.
My question is if there is a way to work around this? Or any way to cast the
dynamically allocated arrays to fit the type definition of the functions?
I'm relatively new to C++, so any help will be greatly appreciated.
Best Regards
Thomas Hede Jensen
I'm currently working on a project in which I link to a library where the
function definitions takes parameters of the type: "const int *const
*paramName"
As far as I can tell from the example of usage this type definition requires
a const int array, however, I do not know the size of those arrays at
compile time (due to the nature of other parts of my code), thus I have to
dynamically allocate the arrays by using "new". Passing parameters of this
type results in the compiler error:
'Create' : none of the 4 overloads can convert parameter 3 from type 'int *'
I have tried type casting or reinterpret_cast, none of which works, also I
tried passing the parameters as "**int", this compiles, but this throws an
exception at runtime.
My question is if there is a way to work around this? Or any way to cast the
dynamically allocated arrays to fit the type definition of the functions?
I'm relatively new to C++, so any help will be greatly appreciated.
Best Regards
Thomas Hede Jensen