How would I write a for loop to output the elements of this vector while being general with the number of elements (without specifying the size of the array).
1 2 3 4 5 6 7 8 9 10 11
vector<int> myList( 5 );
int i;
unsignedint length;
myList[ 0 ] = 3;
for ( i = 1; i < 4; i++ )
myList[ i ] = 2 * myList[ i – 1 ] – 5;
myList.push_back( 46 );
myList.push_back( 57 );
myList.push_back( 35 );