C++ Programming Code Examples C++ > Arrays and Matrices Code Examples Accessing Array Elements in C++ Accessing Array Elements in C++ int newArray[10]; int n = 0; // Initializing elements of array seperately for(n=0;n<sizeof(newArray);n++) { newArray[n] = n; } int a = newArray[5]; // Assigning 5th element of array value to integer 'a'.