0

I am developing a application which needs functions of int64 variables. and i was told offset64 or int64_t is viable for my need... But i just wanna what is the prototype of int64 under 32bit system... How can i use the variable. is it a struction which consists of two ULONGs? thanx !

StevenWang
  • 3,625
  • 4
  • 30
  • 40

2 Answers2

2

There's usually no reason why the compiler can't support 64-bit integer types transparently on a 32-bit (or smaller) platform since it can generate the code necessary to handle them in smaller chunks whenever they are used. AFAIK any C99-compliant compiler should support 64-bit types transparently through the stdint.h header file which defines types such as int64_t and you can use them as you would any other integer type.

[Edit] Example :

#include <stdint.h>
#include <stdio.h>
int main(void) {
        int64_t x = 0x1000000000LL;

        x = x*2;
        printf("%llX\n", x);
}
Per Knytt
  • 1,931
  • 1
  • 11
  • 14
1

Use long long, both msvc and gcc support it.

Nikola Smiljanić
  • 26,745
  • 6
  • 48
  • 60