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"
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;
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
>> 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?
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
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.html1. 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::.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Yeah it works!