猿问

C++ for_each传入参数的问题

//以下代码为何提示重复定义了成员方法,希望大神能给予解答

#include
#include 
#include
#include 
#include 
//#include "myClass.h"

using namespace std;
void eraseStr11(const char & c,string & s)
{
if(!isalpha(int(c)))
s.erase(c);
}

int main()
{
string str;
getline(cin, str);
string strTmp(str);

for_each( str.begin(), str.end(), bind2nd(ptr_fun(eraseStr11), str));
cout << strTmp;

system("pause");
return 0;

}


互换的青春
浏览 1065回答 1
1回答
随时随地看视频慕课网APP
我要回答