728x90
반응형
for_each
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
void func(string str)
{
cout << str << endl;
}
void main()
{
vector<string> vs;
vs.push_back("로보트 태권 브이");
vs.push_back("들장미 소녀 캔디");
vs.push_back("바보 온달과 평강 공주");
vs.push_back("독수리 오형제");
for_each(vs.begin(),vs.end(),func);
}
728x90
반응형
댓글