Problems using the double datatype

Discussion in 'C++' started by meyup, Mar 22, 2010.

  1. meyup

    meyup New Member

    Joined:
    Feb 15, 2010
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    0
    Hi,

    I'm having issues with some basic cpp. Basically when I try to use the double data type eg.

    double d = 10;

    then print the value of d to the screen it comes up as 0.

    Any help would be greatly appreciated

    Thanks,
     
  2. creative

    creative New Member

    Joined:
    Feb 15, 2010
    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    0
    There's no way to give any real help if you don't post your code. Try the following program. What is the output?

    Code:
    #include <iostream>
    
    int main()
    {
        double d = 10;
        std::cout << d;
        return 0;
    }
    
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice