64 bit integer and c

Is the cc++ standard updated for new
64 bit procesor capabilities.
I know that long int is 32 bit
but how do i declare 64 bit integer.

Comments

  • int isn't 32 bit. int is larger or equal to short. This is what you know:

    char = 1 byte
    wchar_t = 2 bytes

    char < short <= int <= long <= long long

    The types "wchar_t" and "long long" are only supported in the latest C standard ISO 9899:1999, also known as "C99".
  • Exactly, but if you like you could do something like this:
    [code]
    #if sizeof(int) == 8
    #define int64 int
    #elseif sizeof(long) == 8
    #define int64 int
    ...
    #endif
    [/code]

    Also it was a long time since I wrote preprocessor code...
    It could (should) be wrong.

    EDIT: If the compiler can use 64 bit, it will...
  • [b]#elif[/b] sizeof(long) == 8

    Yeah, the pre-processor has strange syntax :-)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories