hi every body. I have question regarding the tracing of these codes and also why we used the for loop.
#include <iostream>
#include <vector> //include the vector library
using namespace std;
int main()
{
vector<int>myVector;
myVector.push_back(2);
myVector.push_back(7);
myVector.push_back(7); //vector<int>mybector;
for(int i=0; i<myVector.size(); i++) // to use the size member function. use myVector.size()
{
cout << myVector[i];
}
}