I am confused about how to create a dynamic defined array:
int *array = new int[n];
I have no idea what this is doing. I can tell it\'s c
The new operator is allocating space for a block of n integers and assigning the memory address of that block to the int* variable array.
n
int*
array
The general form of new as it applies to one-dimensional arrays appears as follows:
array_var = new Type[desired_size];