Gave it a go and here's what I got:
Code:
#include<iostream>
#include<vector>
using namespace std;
int main();
{
vector<int> list;
int number=0;
vector<int>::iterator beg=list.begin();
list.end()=100;//not sure if this will work or if I say that the end if when when size=100, 100 elements
while(iter!=list.end()){
number++;
list.push_back(number);
cout<<number<<endl;
//setw stuff goes here
cout<<number*number;
}else
++iter;
}
Problems are, not sure how to use setw,or should I use something else. If so what? Other than that am I writing to the vector elements properly?