CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2003
    Posts
    24

    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.

  2. #2
    Join Date
    Oct 2002
    Location
    Singapore
    Posts
    3,128
    Did you include <limits> and specifies the namespace, like "using namespace std;"

  3. #3
    Join Date
    Nov 2003
    Posts
    24
    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.

  4. #4
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    153
    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

  5. #5
    Join Date
    Nov 2003
    Posts
    24
    yes .it is okay.thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured