I need an array where each member has 3 elements of the same type. I can use an array of structs, or a 2 dimensional array.
// Array of structs:
struct point { double x, y, z; };
struct point path[20000];
// Now access z by
path[i].z
// 2-dimensional array:
double path[20000][3];
// Access z by
path[i][2]
Which method is most efficient? Or are they the same?