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
Hi all, we have some important news to share. Please follow the link here to find out more!

https://www.boards.ie/discussion/2058419143/important-news/p1?new=1

Quick C++ Question

  • 15-12-2005 12:11PM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 2,082 ✭✭✭Tobias Greeshman


    using ::pow ;
    


  • Registered Users, Registered Users 2 Posts: 871 ✭✭✭gerTheGreat


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


  • Registered Users, Registered Users 2 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