Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Quick C++ Question

Options
  • 15-12-2005 12:11pm
    #1
    Registered Users Posts: 871 ✭✭✭


    Very simple question: I'm trying to use the pow method from cmath, but I getting an error:

    error C2873: 'pow' : symbol cannot be used in a using-declaration

    I'm sure it's something very simple that I've over looked. I've inported cmath, do I have to use something something like:

    using pow;

    or

    using cmath.pow;

    Thanks
    Ger...


Comments

  • Registered Users Posts: 2,082 ✭✭✭Tobias Greeshman


    using ::pow ;
    


  • Registered Users Posts: 871 ✭✭✭gerTheGreat


    Nope, that's still giving the same error.:(


  • Registered Users Posts: 2,082 ✭✭✭Tobias Greeshman


    Worked for me anyways the using shouldn't really be necessary, try just using the pow function as normal, without any resolution operators... eg:
    double x = pow ( 2, 3 ) ;
    

    When you include the cmath include, it normally just includes the old c math.h header file.


Advertisement