Thanks, timmay3141 and globos; I eventually wrote the integral thus, but have a problem calling it:
double* function(double *p,double *func,int nSize,CKuchukDlg *pDialog);
void qgaus(double *ans, int nSize, CKuchukDlg *pDialog)
{
enum{nSize = 6};
//elements of the integral
double xr,xm,dx...