One can create an array by the help of the new operator. In ArrayDemo program, next statement allocates the array along with quite enough memory. This is done for 10 integer elements so that to assign array to anArray variable.
In case if the given statement is missing, an error like this would be printed by compiler and also the compilation would fail.
// create an array of integers
anArray = new int;
To array’s each element,