Creation and use of arrays in C++

Different from vectors and strings, we don’t need to call a library, we only need to write our function “type array [n]” where n is the length of the array or the number of values that the array will be covering.

Screen Shot 2015-11-25 at 02.04.58This will create an array list, a series of elements with the same data type.

In this case, the user is asked to insert the number of values (10 values) to calculate the Average of them and the standard deviation. This is accomplished by an array and with the help of a for loop until the ten spaces of the array are covered.

Screen Shot 2015-11-25 at 02.09.33.png as you can see the for loop has a condition and until this conditions are completely covered, the loop will keep repeating over and over again.

 

CC BY 4.0 Mastery 24 by Luis Daniel García is licensed under a Creative Commons Attribution 4.0 International License.