How to guarantee a 64‑bit integer across platforms in C

1 Answer

0 votes
#include <stdio.h>
#include <stdint.h>

int main(void) {
    int64_t x  = -123456789012345;
    uint64_t y = 123456789012345ULL;

    printf("x = %lld\n", (long long)x);
    printf("y = %llu\n", (unsigned long long)y);

    return 0;
}



/*
run:

x = -123456789012345
y = 123456789012345

*/

 



answered Feb 23 by avibootz
...