I have a 2D array as follows:
which is used to determine the four corners of a 2D bounding box of a curve.
However, since I do not know how many curves are to be processed, I would like to dynamically allocate memory, knowing that the number of corner points (4) will be in 3D coordinates (3). I therefore declared my variable as such:
and tried to allocate it as follows:
pCornerPoints = new double[curves.size()];
to which Visual Studio's intellisense gave the message Expression must be a modifiable lvalue.
How would I go about allocating memory for it? Is it even possible? If so, what is the syntax (using the new and malloc operators)? I know how to allocate a complete dynamic 3D array, but I would like to avoid it if possible.