I want to print the elements of the vector. The following is my code.
After searching I found the following code and its working:
for(int i=0;i<vec.size();i++)
cout<<vec[i]<<" ";
But can't we use iterators to access the elements? if possible, how?