Q: 11
What happens when you attempt to compile and run the following code?
#include
#include
int main ()
{
std::vectorv1;
for(int i = 10; i>0; i??)
{
v1.push_back(i);
}
std::vector::iterator it = v1.begin();
int sum = 0;
while(it != v1.end())
{
sum+=it++;
}
std::cout<<*v1.erase(v1.begin(),v1.end()?3)<<" "<<sum <<std::endl;
return 0;
}
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.