Take the 2-minute tour ×  I'm familiar with Java and trying to
teach myself C/C++. I'm stealing some curriculum from a class
that is hosting their materials here. I unfortunately can't ask
the teacher since I'm not in the class. My concern is with the
section under "dynamically declared arrays":  If you want to be
able to alter the size of your array at run time, then declare
dynamic arrays. These are done with pointers and the new
operator. For the basics on pointers, read the pointers section.
Allocate memory using new, and then you access the array in the
same way you would a static array. For example,  int* arrayPtr =
new int[10]; for (int i = 0; i < 10; i++) { arrayPtr[i] = i; }
The memory picture is identical to the static array, but you can
change the size if you need to. Don't forget you must deallocate
the memory before allocating new memory (or you will have a
memory leak).  delete [] arrayPtr; // the [] is needed when
deleting array pointers arrayPtr = new int[50]; . . .  When
you're completely d