answersLogoWhite

0

A matrix is a two-dimensional array of objects. If, for instance, you wanted a 10 by 20 matrix (array) of doubles, you would say...

double mydoublearray[10][20];

You would then refer to each element with the syntax...

double somedouble;
somedouble = mydoublearray[3][7];

Note that array indices start from zero, and go to the declared size minus one, so the first element is mydoublearray[0][0]and the last element is mydoublearray[9][19].

You can have arrays of elementary types and of classes. The syntax is the same. Just use the class name instead of the word double.

User Avatar

Wiki User

15y ago

What else can I help you with?