New to C++. Working with: GCC C++ Compiler; Eclipse Neon (4.6.0); OS X Sierra
I have a program with an object type ArrangementNode
, one member of which is an array of ints called occupiedArray
. I do not know how many ints occupyArray
needs to hold until runtime, so I want the size of occupiedArray
to be an int variable with a value determined at runtime. But, the compiler will not let me initialize the array with a variable size: error: fields must have a constant size: 'variable length array in structure' extension will never be supported
.
This has to be a common need in C++. How should I be approaching this?