Home / utk / cs102 / fa16 / labj / code_snippets / section1 / vec_ex.cpp
Directory Listing
argtest.cpp
point3d.cpp
string_to_int.cpp
test.ppm
vec_ex.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include <vector>

using namespace std;

int main() {
	vector<int> vec;
	vec.resize(2);
	vec[0] = 42;
	vec[1] = 90;
	vec.push_back(112);
	
	for (int i = 0; i < vec.size(); i++) {
		cout << vec[i] << endl;
	}
}