#include < iostream >
#include < string >
#include < algorithm >
#include < cctype >
using namespace std;
int main(void)
{
string tmp("ABC");
cout << tmp << endl;
transform(tmp.begin(),
tmp.end(),
tmp.begin(),
tolower);
cout << tmp << endl;
return 0;
}
GCC can not accept above codes, compile error happens.
Becuase "tolower" function is not certain type.
So I builded wrapper function of tolower, Compile is succeed.
 


No comments:
Post a Comment