Thread: what should i use

  1. #16
    DESTINY BEN10's Avatar
    Join Date
    Jul 2008
    Location
    in front of my computer
    Posts
    804
    Quote Originally Posted by c.user View Post
    Code:
        printf("%lu\n", (long unsigned int) main);
    try to long specifier

    update:
    oh, I didn't use -Wall, it need cast
    i used this and it also gives me this warning
    Code:
    Warning	1	warning C4311: 'type cast' : pointer truncation from 'int *__w64 ' to 'unsigned long'
    so %p is the standard way to do it(although it gives the result in hex).
    HOPE YOU UNDERSTAND.......

    By associating with wise people you will become wise yourself
    It's fine to celebrate success but it is more important to heed the lessons of failure
    We've got to put a lot of money into changing behavior


    PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D.
    IDE- Microsoft Visual Studio 2008 Express Edition

  2. #17
    Registered User
    Join Date
    Apr 2009
    Location
    Russia
    Posts
    116
    Code:
        printf("%llu\n", (unsigned long long int) main);
    unsigned long long int - 8 bytes (64 bits), C99 hence

    you can search __w64 type defined in VS includes (which type it bases on)
    Last edited by c.user; 04-30-2009 at 09:21 PM.

  3. #18
    DESTINY BEN10's Avatar
    Join Date
    Jul 2008
    Location
    in front of my computer
    Posts
    804
    Quote Originally Posted by c.user View Post
    Code:
        printf("%llu\n", (unsigned long long int) main);
    unsigned long long int - 8 bytes (64 bits), C99 hence

    you can search __w64 type defined in VS includes (which type it bases on)
    yes. I did %llu and it worked without any warnings.
    HOPE YOU UNDERSTAND.......

    By associating with wise people you will become wise yourself
    It's fine to celebrate success but it is more important to heed the lessons of failure
    We've got to put a lot of money into changing behavior


    PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D.
    IDE- Microsoft Visual Studio 2008 Express Edition

  4. #19
    Registered User
    Join Date
    Apr 2009
    Location
    Russia
    Posts
    116
    it is a lengthening only
    Last edited by c.user; 04-30-2009 at 11:19 PM.

Popular pages Recent additions subscribe to a feed