User guide
18-76
DirectC Interface
int sum = 0;
int i1, i2, i3, i4, indx;
i1 = vc_getInteger(vh_indx1);
i2 = vc_getInteger(vh_indx2);
/* loop over all possible indices for that slice */
for (i3 = 0; i3 < vc_mdaSize(vh_array, 3); i3++) {
for (i4 = 0; i4 < vc_mdaSize(vh_array, 4); i4++) {
indx = vc_Index(vh_array, i1, i2, i3, i4);
sum += vc_getMemoryInteger(vh_array, indx);
}
}
return sum;
}
There are specialized, more efficient versions for two and three
dimensional arrays. They are as follows.
int vc_Index2(vc_handle, U, U)
Specialized version of vc_Index() where the two U parameters are
the indices in a two dimensional array.
int vc_Index3(vc_handle, U, U, U)
Specialized version of vc_Index() where the two U parameters are
the indices in a three dimensional array.
U vc_mdaSize(vc_handle, U)
Returns the following:
• If the U type parameter has a value of 0, it returns the number of
indices in the multi-dimensional array.