const unsigned int num = 3; extern "C"{ void search(float* result,float* longitude,float* latitude,float* out,int size){ for (int i =0; i < size; i++){ out[num*i] = longitude[i]; out[num*i+1] = latitude[i]; out[num*i+2] = result[i]; } } }