본문 바로가기

카테고리 없음

[C/C++] std::tolower

https://stackoverflow.com/questions/16792456/no-matching-function-for-call-to-transform

 

no matching function for call to 'transform

can anyone tell me what is the mistake in this program #include #include using namespace std; int main() { string str = "Now"; transform(str.begin(), ...

stackoverflow.com

transform()을 사용할 때 왜 ::tolower를 사용해야 하는가?

std안에 2개의 tolower가 있기 때문.

::를 통해 해결할 수 있다는 것은 아마 cctype의 tolower(우리가 사용하고자 하는 것)은 전역범위에 선언되어 있고 locale의 tolwer는 std안에 있는 듯.