Hello all,
I am trying to integrate a C libary (well, a C API to a C++ library) and I am getting an error when passing arrays to the C function.
I have a C function defined as:
C_API const char* myfunc(const char* ccy, const int days[], const int n_days,const double dfs[], const int n_dfs, const int anchor_date, const char* dycnt);
and I define the arrays days[] and dfs[] as:
d = c_int * 10
r = c_double * 10
days = d(1,2,3,4,5,6,7,8,9,10)
dfs = r(1.0, 2.0, 3.0,4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0)
and the error I get is :
WindowsError: exception code 0xe06d7363
The function I should mention works fine from C.
Also, I have another function defined as:
C_API const char* myfunc2(const char* type, int n_factors, const double** data, const int n_rows, const int n_cols);
and if I pass one of the single dimension arrays from above for the data variable, I get the following error:
WindowsError: exception: access violation reading 0x00000001
Any help would be greatly appreciated.
Thanks,
I am trying to integrate a C libary (well, a C API to a C++ library) and I am getting an error when passing arrays to the C function.
I have a C function defined as:
C_API const char* myfunc(const char* ccy, const int days[], const int n_days,const double dfs[], const int n_dfs, const int anchor_date, const char* dycnt);
and I define the arrays days[] and dfs[] as:
d = c_int * 10
r = c_double * 10
days = d(1,2,3,4,5,6,7,8,9,10)
dfs = r(1.0, 2.0, 3.0,4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0)
and the error I get is :
WindowsError: exception code 0xe06d7363
The function I should mention works fine from C.
Also, I have another function defined as:
C_API const char* myfunc2(const char* type, int n_factors, const double** data, const int n_rows, const int n_cols);
and if I pass one of the single dimension arrays from above for the data variable, I get the following error:
WindowsError: exception: access violation reading 0x00000001
Any help would be greatly appreciated.
Thanks,