Update Array Element
To update an element in an array, we can use the index which we want to update enclosed within the array subscript operator and assign the new value.
arr[i] = new_value;
C++ Arrays
In C++, an array is a data structure that is used to store multiple values of similar data types in a contiguous memory location.
For example, if we have to store the marks of 4 or 5 students then we can easily store them by creating 5 different variables but what if we want to store marks of 100 students or say 500 students then it becomes very challenging to create that numbers of variable and manage them. Now, arrays come into the picture that can do it easily by just creating an array of the required size.