Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (14 sloc) 0.411 kB
#include <algorithm>
#include <iostream>
#include <vector>
int main(void) {
int list[] = { 1, 2, 3, 4, 5, 6, 7 };
std::vector<int> v;
v.resize(7); // Allocate space for 7 elements.
std::copy(list, list + 7, v.begin());
std::cout << "The vector elements are:";
for (std::vector<int>::iterator i(v.begin()); i != v.end(); ++i)
std::cout << " " << *i;
std::cout << std::endl;
return 0;
}
Jump to Line
Something went wrong with that request. Please try again.