Is it possible to change the number of bytes a long has in visual studio? Currently when compiling C code sizeof(int) and sizeof(long) are both equal to 4.
doesn't work. You get error syaing __int64 followed by long is illegal.
Reflux
2010-09-29 16:59:53
Mmm, #define long __int64 :-)
BarsMonster
2010-09-29 17:01:07
+2
A:
Since you're using Visual Studio, presumably your target platform (and the libraries you're using) target Windows. The Win64 platform uses an LLP64 model (http://msdn.microsoft.com/en-us/library/aa384083.aspx) where int
and long
are 32-bits. It would be futile I think to try to make long
a 64-bit type in that situation.
Use int64_t
(from stdint.h
) or long long
or similar to get a 64-bit integer type
Michael Burr
2010-09-29 17:09:09