Mega Code Archive
Demonstrating the four ways that vectors can be created
#include
#include
using namespace std;
int main()
{
vector a; // empty
vector b(5, 'X'); // size and initialize
vector c(b); // initialize with another vector
int i;
for(i = 0; i <5; i++)
a.push_back('A'+i);
// create a vector from a range
vector d(a.begin()+1, a.end()-1);
for(i = 0; i