1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
#include<iostream>
#include<vector>
#include<algorithm>
#include<iterator>
#include<cctype>
using namespace std;
int main() {
char cList[10] = {'a', 'i','C', 'd', 'e', 'f', 'o', 'H', 'u', 'j'};
ostream_iterator<char> screen(cout, " ");
vector<char> charList(cList, cList + 10);
vector<char>::iterator position;
position = find(charList.begin(), charList.end(), 'd');
// copy(charList.begin(), charList.end(), screen);
cout<<endl;
cout<< endl << *position;
position = find_if(charList.begin(), charList.end(), isupper);
cout << endl << *position;
}
|