Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

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