#include <math.h> // otherwise C++ function names are mangled extern "C" { void float_multiply_array(float *data, int w, int h, int ncpp) { int length = w*h; int currentPixelIndex = 0; for(int i=0; i<w; i++){ for(int j=0; j<h; j++){ currentPixelIndex = j * w + i; data[currentPixelIndex] = pow( data[i] , 2 ); } } } }