Vector Help

This is a discussion on Vector Help within the C++ Programming forums, part of the General Programming Boards category; Say i have code like below:
Code:
vector<int> test;
test.push_back(1);
test.push_back(2);
for(size_t i = 0; i < test.size(); ++i)
cout ...

Error 1 error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::vector<_Ty>' (or there is no acceptable conversion) d:\school\comp446\project\genalib\genalib.cpp 18

So how would i use the [] operator of the vector stl templates when i use a pointer to a vector or int's? Would i have to use test->at(i)? It works if i do that but im just wondering if i can use the [] operator or not.