John Love-Jensen wrote:
On 7/1/08 2:17 PM, "Yang Zhang" <yanghatespam@xxxxxxxxx> wrote:
Hi, why isn't int64_t == long long at least on 64-bit x86 Linux?
Because int64_t should be 64-bit, but long long could be 64-bit or larger.
#include <stdint.h> // from C99
#include <climits>
cout << (sizeof(int64_t) * CHAR_BIT) << endl;
cout << (sizeof(long long) * CHAR_BIT) << endl;
cout << sizeof(int64_t) << endl;
cout << sizeof(long long) << endl;
print:
8
8
You can also do this:
#include <stdint.h> // from C99
#include <typeinfo>
cout << typeid(int64_t).name() << endl;
cout << typeid(long long).name() << endl;
This prints:
l
x
What does this mean? (typeid(string).name() prints "Ss")
--
Yang Zhang
http://www.mit.edu/~y_z/