Where is in Visual Studio 2005?

2019-01-20 08:11发布

I'd like to use the C99 header file inttypes.h in a Visual Studio project (I'd like to printf 64 bit numbers).

However, this file does not seem to exist in my install.

Is this just not part of VS2005? Are there any alternatives?

4条回答
Rolldiameter
2楼-- · 2019-01-20 08:20

Visual C++ does define its own sized types:

__int8
__int16
__int32
__int64
查看更多
做自己的国王
3楼-- · 2019-01-20 08:26

It's at google. VS doesn't come with <inttypes.h>

查看更多
别忘想泡老子
4楼-- · 2019-01-20 08:27

For Visual Studio 2005 see the bug "C99 header <inttypes.h> missing" at http://connect.microsoft.com/VisualStudio/feedback/details/99133/c99-header-inttypes-h-missing#details where it seems Microsoft did not plan to add the file to Visual Studio 2005.

It seems to me that inttypes.h is missing also from Visual Studio 2010.

For the C++ header <cinttypes> in Visual Studio 2012 see the bug "C++11 header is missing (Microsoft Visual Studio Ultimate 2012 RC 11.0.50522.1)" at https://connect.microsoft.com/VisualStudio/feedback/details/748766/c-11-header-cinttypes-is-missing-microsoft-visual-studio-ultimate-2012-rc-11-0-50522-1

查看更多
冷血范
5楼-- · 2019-01-20 08:34

No, it is not included in VS 2005.

An alternative is Boost's implementation in the Boost::Integer library, specifically boost/cstdint.hpp

查看更多
登录 后发表回答