How to printf a long long data type integer?

Discussion in 'C Programming' started by music4, Jan 5, 2004.

  1. music4

    music4 Guest

    Greetings,

    I need to use a long long data type integer in my program, but how to print
    it with printf() or an alternative? My platform is Solaris 2.7 32bit
    operating system, and I use Sun Forte 6 C compiler.

    Thanks in advance!
    Evan
    music4, Jan 5, 2004
    #1
    1. Advertising

  2. music4

    Jack Klein Guest

    On Mon, 5 Jan 2004 09:23:26 +0800, "music4" <> wrote in
    comp.lang.c:

    > Greetings,
    >
    > I need to use a long long data type integer in my program, but how to print
    > it with printf() or an alternative? My platform is Solaris 2.7 32bit
    > operating system, and I use Sun Forte 6 C compiler.
    >
    > Thanks in advance!
    > Evan


    The conversion specifiers for long long include "%lld" "%llu" "%llx"
    and so on.

    --
    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++
    http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
    Jack Klein, Jan 5, 2004
    #2
    1. Advertising

  3. music4

    music4 Guest

    Jack,

    Thank you so much. It solved my problem. By the way, where you get the
    knowledge, I did never read them from any book.

    Evan

    "Jack Klein" <> wrote in message
    news:...
    > On Mon, 5 Jan 2004 09:23:26 +0800, "music4" <> wrote in
    > comp.lang.c:
    >
    > > Greetings,
    > >
    > > I need to use a long long data type integer in my program, but how to

    print
    > > it with printf() or an alternative? My platform is Solaris 2.7 32bit
    > > operating system, and I use Sun Forte 6 C compiler.
    > >
    > > Thanks in advance!
    > > Evan

    >
    > The conversion specifiers for long long include "%lld" "%llu" "%llx"
    > and so on.
    >
    > --
    > Jack Klein
    > Home: http://JK-Technology.Com
    > FAQs for
    > comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
    > comp.lang.c++ http://www.parashift.com/c -faq-lite/
    > alt.comp.lang.learn.c-c++
    > http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
    music4, Jan 5, 2004
    #3
  4. music4

    CBFalconer Guest

    music4 wrote:
    > "Jack Klein" <> wrote in message
    > > <> wrote in
    > >
    > > > I need to use a long long data type integer in my program,
    > > > but how to print it with printf() or an alternative? My
    > > > platform is Solaris 2.7 32bit operating system, and I use
    > > > Sun Forte 6 C compiler.

    > >
    > > The conversion specifiers for long long include "%lld" "%llu"
    > > "%llx" and so on.

    >
    > Thank you so much. It solved my problem. By the way, where you
    > get the knowledge, I did never read them from any book.


    Probably from the C99 standard. Google for N869 for a free
    version of the last draft.

    --
    Chuck F () ()
    Available for consulting/temporary embedded and systems.
    <http://cbfalconer.home.att.net> USE worldnet address!
    CBFalconer, Jan 5, 2004
    #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. Piotr B.
    Replies:
    6
    Views:
    8,937
    Martin Ambuhl
    Oct 19, 2004
  2. Joerg Schwerdtfeger

    printf / sscanf unsigned long long int variables

    Joerg Schwerdtfeger, Apr 2, 2004, in forum: C Programming
    Replies:
    3
    Views:
    40,126
    Joerg Schwerdtfeger
    Apr 2, 2004
  3. Schraalhans Keukenmeester

    printf unsigned long long as hex

    Schraalhans Keukenmeester, Jul 1, 2007, in forum: C Programming
    Replies:
    5
    Views:
    32,480
    Army1987
    Jul 2, 2007
  4. Suresh V
    Replies:
    5
    Views:
    3,680
    SaticCaster
    Jul 5, 2010
  5. Hans Vlems

    long long int and sscanf, printf

    Hans Vlems, Sep 7, 2012, in forum: C Programming
    Replies:
    5
    Views:
    1,529
    Hans Vlems
    Sep 7, 2012
Loading...

Share This Page