struct user { double xend, h; Integer k; }; main() { Integer neq = 3; double x = 0.0, tol = 0.0001, y[3] = {1.0, 0.0, 0.0}; Nag_User comm; struct user s; /* assign address of user defined structure to comm.p */ comm.p = (Pointer)&s; s.xend = 10.0; s.k = 4; s.h = (s.xend-x) /(double)(s.k+1); d02ejc(neq, fcn, 0, &x, y, s.xend, tol, Nag_Relative, out, 0, &comm, NAGERR_DEFAULT); } static void out(Integer neq, double *xsol, double y[], Nag_User *comm) { Integer j; struct user *s = (struct user *)comm->p; Vprintf("%8.2f", *xsol); for (j=0; j<3; ++j) Vprintf("%13.5f", y[j]); Vprintf ("\n"); *xsol = s->xend - (double)s->k * s->h; s->k--; }