zoukankan      html  css  js  c++  java
  • This project fills the absence of stdint.h and inttypes.h in Microsoft Visual Studio

    http://code.google.com/p/msinttypes/

    msinttypes

    This project fills the absence of stdint.h and inttypes.h in Microsoft Visual Studio. This files were standartized by ISO/IEC as a part of C99standard library. If you want to compile or use C99 compliant project with Microsoft Visual Studio, you will likely find that you're missing these headers. Note though, that just adding these header does not make Visual Studio compiler fully C99 compliant.

    FFMpeg is a good example of library that requires inttypes.h even if you just want to link your program with it.

    More portable version of stdint.h can be find here but it does not implement inttypes.h features, such as printf and scanf format specifiers.

     

    C99中添加了几个新的头文件,VC++中没有,所以需要你自己下载

    判断支持C98 或者 C99 代码

    View Code
    #include<stdio.h>
    #include<tchar.h>
    
    //int main()
    //int _tmain(int argc, _TCHAR* argv[])
    int _tmain()
    {
    #if (defined(__STDC_VERSION__))
     printf("标准C版本:%ld。", __STDC_VERSION__);
    #elif (!defined(__STDC__))
     printf("非标准C!");
    #else
     printf("旧的标准C。");
    #endif
     getchar();
     return 0;
    }

    http://blog.csdn.net/rodmanwu/article/details/6846788

    stdint.h是C99的标准,主要用于统一跨平台数据定义。
    MSVC中不带有这个头文件,直到VS2010(新闻)。

    在之前的版本里面,我们可以:
    (1)下载这个头文件
    download a MS version of this header from:
    http://msinttypes.googlecode.com/svn/trunk/stdint.h
    A portable one can be found here:
    http://www.azillionmonkeys.com/qed/pstdint.h
    (2)将头文件放到(以VS2008为例):
    C:\Program Files\Microsoft Visual Studio 9.0\VC\include


    (以VS2011为例): D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include 需要 inttypes.h

  • 相关阅读:
    SQL Server 创建用户报错:消息 15023,级别 16,状态 1,第 1 行 用户、组或角色 'XXX' 在当前数据库中已存在。
    Win10安装sqlserver2014打开显示黑色界面,mardown打开显示报错
    Centos7磁盘超过2TB使用parted命令分区
    Html5學習重點清單
    jQuery源码学习扒一扒jQuery对象初使化
    jQuery源码学习
    算法排序之插入排序
    算法排序之冒泡排序
    Sublime Text 3 安装
    css布局你该了解的
  • 原文地址:https://www.cnblogs.com/logitechlike/p/2873018.html
Copyright © 2011-2022 走看看