Code (based on Numpy C-Api example gives a SegFault. The link to the tutorial they were following is dead, and I haven't found a good tutorial):
#include <Python.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#include "numpy/arrayobject.h"
int main()
{
   Py_Initialize();
   import_array();
   int typenum;
   PyArrayObject *alpha;
   PyObject *a = NULL;
   int n = 100;
   int nd = 1;
   int dims[nd];
   dims[0] = n;
   a= PyArray_FromDims(nd, dims, NPY_DOUBLE);
   alpha = (PyArrayObject*) a;
   typenum = PyArray_DIMS(alpha)[0];
   printf("%i",typenum);
   PyRun_SimpleString("print 'Hello Python C/API'");
   Py_Finalize();
   return 0;
}
gcc -g main1.cpp -I/.../include/python2.7 -I/.../numpy/numpy/core/include -lpython2.7 -lstdc++; ./a.out
Gives a segfault on a= PyArray_FromDims(nd, dims, NPY_DOUBLE);.  
I'm in a virtualenvironment, which has ben activated. The "..." gives the path to my virtual environment where numpy lives as a subdirectory, and has been installed using pip install -e numpy.