Segmentation fault in PyArray_SimpleNewFromData
I am looking to pass an array from C++ to Python using C-API. By looking at various topics here, I came to know that I should be using PyArray_SimpleNewFromData method. When I am trying to implement on a very small array, I am getiing a segmentation fault in my code which I am not able to detect. Can anyone help me with this issue? C++ code : void init_numpy() { import_array(); } int main(int argc, char *argv[]) { PyObject *pName, *pModule, *pDict, *pFunc, *pValue, *pArgs, *pXVec, *xarr1; PyObject *c ; PyObject *pValue1 ; int fArray[2] = {10,1} ; PyObject *p = NULL ; npy_intp m1 = 2; Py