I'm having trouble getting to grips with the syntax of new in c++. I come from a C background.
The thing is I have a an array
so a pointer to an array of 3 floats. I now wish to allocate memory to the pointer arr so that it can hold an array of float-triples. I know I could do it by making arr of type float ** instead and then allocate in a loop, but since I know the length of each element there must be an easier way that clearly shows my intention.Code:float (*arr)[3]
I tried with
but this refuses to compile.Code:arr=new float[3] [N]