Hi,

So I am a very novice programmer, and have never tried to do this before.

I need a tripd define the x,y and z components of a vector.

I have everything declared as a tripd, but it seems like it would be infinitly more efficient to do a tripd/array combo.Code:vij2.fx = ri[0].fx - pos2.fx; vij2.fy = ri[0].fy - pos2.fy; vij2.fz = ri[0].fz - pos2.fz; vij3.fx = ri[0].fx - pos3.fx; vij3.fy = ri[0].fy - pos3.fy; vij3.fz = ri[0].fz - pos3.fz; vij4.fx = ri[0].fx - pos4.fx; vij4.fy = ri[0].fy - pos4.fy; vij4.fz = ri[0].fz - pos4.fz;

The question is can I do this, I thought it would be easier to ask here rather than deal with a five page compiler error in Unix.Code:for (k = 2; k < 5; k++) { vij[k].fx = ri[0].fx - pos[k].fx; vij[k].fy = ri[0].fy - pos[k].fy; vij[k].fz = ri[0].fz - pos[k].fz; }

Thanks

Rachael