开发者

Visual Studio Changing number of bytes for data type

Is it possible to change the number of bytes a long has in visual studio? Currently when compiling C c开发者_开发百科ode sizeof(int) and sizeof(long) are both equal to 4.


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


typedef __int64 long;

That kind of nasty things.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜