Hey everyone,
im trying to get to know vectors but i came to a point that my current knowledge stops and i need more help,
i found a program which i would like to understand but i couldn't figure it out.
here is the code:
#include<iostream>
#include<vector>
#include<string>
#include<iterator>
using namespace std;
bool islowerCase(char c)
{
return islower(c);
}
int main()
{
const int size=10;
vector<char>v1;
vector<char>::iterator lastElem;
const char charList[size]={'w','W','b','B','C','E','w','F','B','m'};
for(int i=0;i<size; i++)
{
v1.push_back(charList[i]);
}
lastElem =remove_if(v1.begin(), v1.end(), islowerCase);//line1
ostream_iterator<char> screen(cout, "");//line2
copy(v1.begin(), lastElem, screen);//line3
cout<<endl;
}
can somebody explain to me line 1,2 and three (where it is shown as comments)
in detail because i am really struggling to understand how it works thanks a lot