Arggh, you're running in circles.
ALL you have to do is remove the () from std::tolower(). Instead, you also removed the std:: in the front, which broke it again.
Use "std::tolower"
Printable View
Arggh, you're running in circles.
ALL you have to do is remove the () from std::tolower(). Instead, you also removed the std:: in the front, which broke it again.
Use "std::tolower"
*cough*
Not that that's a good idea, but because it's there, the std:: is not required.Code:using namespace std;
>> Not that that's a good idea, but because it's there, the std:: is not required.
No, it is required because the compiler is confused about which version of tolower to use. This was explained much earlier in the thread.
Now I'm confused. :) I looked, but I don't see what you mean . . . the compiler shouldn't be confused about which version of tolower() to use, because there's only one version, as long as only one of <ctype.h> and <cctype> is included.
As far as I know, one should use std::tolower, unless there's a using namespace std or equivalent, in which case it's okay to leave off the std::. Can you elaborate?
The best I can find:
http://cboard.cprogramming.com/showp...54&postcount=4
Thanks for the link, it explains things very nicely. But it seems that <locale> defines tolower() (not <iostream>); but <iostream> could include <locale>, which might be why a lack of std:: works on some compilers and not others:
From http://www.thescripts.com/forum/thread62974.htmlQuote:
1. tolower is (also) a template function prototyped in <locale>:
template <class charT> charT tolower(charT c, const locale& loc);
2. Any standard C++ header is allowed to include any other standard C++
header as an implementation detail (reference 17.4.4.1/1).
So . . . to the OP: add std::. :)
Yeah it works!