set array elements to numbers from 1 to the size of array c++ code example Example: initialize array c++ int foo [5];