Visual C++中的int32_t等價於什麼?Visual C++中int32_t的等價物是什麼?
回答
Visual C++ 2010包括<cstdint>
,其中包括typedef std::int32_t
(您也可以包含<stdint.h>
,它在全局命名空間中具有相同的typedef)。
如果您使用的是舊版本的Visual C++,則可以使用Boost's <cstdint>
implementation。
int
。但是,如果要在2010年之前的VC++版本(其中引入cstdint
標頭)中繼續使用stdint typedefs,請考慮使用Boost。 Config的cstdint implementation。
我不是downvoter,但要注意,int32_t簽署。所以你可能應該說:'int',因爲它是VC上的32位。 – 2011-04-14 02:17:39
我不相信你可以保證VC編譯的每個體系結構都有一個32位的int。 – user470379 2011-04-14 03:05:24
@ user470379:由於VC++ 1.52,它實際上保證'int'是32位。如果你使用的是早期版本的VC++,那麼我懷疑你會比'sizeof(int)'更大的問題擔心; - ] – ildjarn 2011-04-14 03:44:13
如果您有預編碼的cstdint
版本的Visual Studio,則可以使用__int32
。
我要做的就是讓我自己的typedef確保類型存在像這樣經過:
#ifdef _MSC_VER
#if _MSC_VER >= 1600
#include <cstdint>
#else
typedef __int8 int8_t;
typedef __int16 int16_t;
typedef __int32 int32_t;
typedef __int64 int64_t;
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
#endif
#elif __GNUC__ >= 3
#include <cstdint>
#endif
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
- 1. 什麼是C++中的instanceof等價物?
- 2. 什麼是C#中的vbNullChar等價物?
- 3. C#中bigint的等價物是什麼?
- 4. C#中TreeBidiMap的等價物是什麼?
- 5. C#中memset的等價物是什麼?
- 6. Visual Basic.NET中C++模板的等價物是什麼?
- 7. 在Visual Studio C++中v4sf和__attribute__的等價物是什麼?
- 8. Visual-C++中的My.Resources等價物是什麼?
- 9. rlwinm的C++等價物是什麼? (PowerPC)
- 10. 什麼是EventWaitHandle的Objective C等價物?
- 11. 什麼是ChrW(e.KeyCode)的C#等價物?
- 12. 什麼是UINT32_MAX的C++等價物?
- 13. &H2的C#等價物是什麼?
- 14. 什麼是C?:operator的Ruby等價物?
- 15. 什麼是C++ typeid的Scala等價物?
- 16. 什麼是Java DecimalFormat的c#等價物?
- 17. 什麼是CRT的C++等價物?
- 18. 什麼是C++ deque的Java等價物?
- 19. 什麼是MsgWaitForMultipleObjects的C#等價物?
- 20. 什麼是Java Socket.getInetAddress()的C#等價物?
- 21. Linux上VIsual C++的_waccess()的等價物是什麼?
- 22. 什麼是C++中的C#靜態實例的等價物?
- 23. 什麼是DocumentCompleted的WPF等價物?
- 24. 目標C中C#中的對象的等價物是什麼?
- 25. 什麼是android中的dataWithContentsOfURL等價物?
- 26. RDFlib中rdf:ID的等價物是什麼?
- 27. Monotouch中的CGPDFDocumentGetCatalog等價物是什麼?
- 28. 什麼是VC7中的strtok_s等價物?
- 29. jquery中Ajax.updater的等價物是什麼?
- 30. 什麼是JSP中的sendmail等價物?
的Visual C++有,只是包括 –
2011-04-14 02:12:53