newbie: format for unsigned long long (c99)

Discussion in 'C Programming' started by TK, Dec 9, 2005.

  1. TK

    TK Guest

    Hi,

    which format can I use for type

    unsigned long long

    in printf()?

    o-o

    Thomas
    TK, Dec 9, 2005
    #1
    1. Advertising

  2. TK

    Jordan Abel Guest

    On 2005-12-09, TK <> wrote:
    > which format can I use for type unsigned long long in printf()?


    there's %llu, %llx, %llo. same other format modifiers apply as to plain
    format %u %x %o.
    Jordan Abel, Dec 9, 2005
    #2
    1. Advertising

  3. TK <> writes:
    > which format can I use for type
    >
    > unsigned long long
    >
    > in printf()?


    In C99, you can apply the "ll" modifier to a following 'd', 'i', 'o',
    'u', 'x', 'X', or 'n'. For example:

    unsigned long long var = ...;
    printf("var = %llu\n", var);

    But note that support for C99 is not universal, and it's not uncommon
    for a compiler to support long long, but for the runtime library not
    to support "ll". (For example, gcc supports long long, but it uses
    whatever runtime library is provided by the system.)

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
    Keith Thompson, Dec 9, 2005
    #3
  4. TK

    TK Guest

    Thanks for help!

    o-o

    Thomas
    TK, Dec 10, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. George Marsaglia

    Assigning unsigned long to unsigned long long

    George Marsaglia, Jul 8, 2003, in forum: C Programming
    Replies:
    1
    Views:
    645
    Eric Sosman
    Jul 8, 2003
  2. Daniel Rudy

    unsigned long long int to long double

    Daniel Rudy, Sep 19, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,161
    Peter Shaggy Haywood
    Sep 20, 2005
  3. Replies:
    3
    Views:
    3,633
    Chris Torek
    Feb 20, 2006
  4. Replies:
    3
    Views:
    575
    Keith Thompson
    Mar 31, 2007
  5. pozz
    Replies:
    12
    Views:
    700
    Tim Rentsch
    Mar 20, 2011
Loading...

Share This Page