vec5.cpp

We use cookies. Read the Privacy and Cookie Policy

vec5.cpp

#include ‹iostream.h›

#include ‹stl.h›

int array[] = {1, 4, 9, 16};

int main() {

 vector‹int› v(array, array + 4);

 for (int i = 0; i ‹ v.size(); i++) cout ‹‹ "v[" ‹‹ i ‹‹ "] = " ‹‹ v[i] ‹‹ endl;

 return 0;

}