-
March 17th, 2004, 03:49 AM
#1
about std::numeric_limits?
hi,guys
i used the std::numeric_limits<double>::max();,but visual C++ 6.0 reported the error C2589: '(' : illegal token on right side of '::'
G:\MY program\temp\test1\test1.cpp(12) : error C2143: syntax error : missing ';' before '::'
anyone know if visual C++ 6.0 support std::numeric_limits?
thanks in advance
Last edited by ephemera; March 17th, 2004 at 03:55 AM.
-
March 17th, 2004, 04:08 AM
#2
Did you include <limits> and specifies the namespace, like "using namespace std;"
-
March 18th, 2004, 05:53 AM
#3
yes, I #include <limits> and using namespace std and set the project option /GX,but it still failed
Last edited by ephemera; March 18th, 2004 at 05:56 AM.
-
March 18th, 2004, 07:10 AM
#4
I thing its because
'max' is already defined as a macro.
try this before your use of
std::numeric_limits<double>::max()
#ifdef max
#undef max
#endif
and see if it works
Greetings,
matze
-
March 18th, 2004, 11:07 AM
#5
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|