Where is <inttypes.h> in Visual Studio 2005?

六月ゝ 毕业季﹏ 提交于 2019-11-27 07:45:52

问题


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?


回答1:


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




回答2:


No, it is not included in VS 2005.

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




回答3:


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




回答4:


Visual C++ does define its own sized types:

__int8
__int16
__int32
__int64


来源:https://stackoverflow.com/questions/1156267/where-is-inttypes-h-in-visual-studio-2005

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!