Original Post
i need to create an array of doubles, of dimensions [3][n]
at the moment I am using 3 separate arrays like so:
__________________________________
n = 23;
double *x;
x = (double *) new double[n];
double *y;
y = (double *) new double[n];
double *z;
z = (double *) new double[n];
__________________________________
what would make it much better would be if I could make an array of structs called, say, testPoints but I dont really know how to do that...
can I just declare a struct in my header file like so
__________________________________
struct TESTPOINTS{
double x =0;
double y =0;
double z =0;
}
__________________________________
then write:
__________________________________
TESTPOINTS *points;
points = (TESTPOINTS *) new TESTPOINTS[n];
_______________________
and if someone could tell me what a TYPEDEF means i would love you lots!
thanks
Joe