zoukankan      html  css  js  c++  java
  • error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead解决方案

    vs2012使用c语言函数fopen操作文件时报错:

    错误  1   error C4996: 'fopen': This function or variable may be unsafe.
     Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
      See online help for details.  c:users
    ootdesktopvc_provc	inyxml2exam1exam1.cpp    28  1   exam1
    

    解决方案:
    第一种是在使用fopen函数的源文件第一行增加:

    #define _CRT_SECURE_NO_WARNINGS

    第二种做法是更改VS2012项目配置:
    项目 ->属性 -> c/c++ -> 预处理器 ,点击预处理器定义,加入_CRT_SECURE_NO_WARNINGS

  • 相关阅读:
    二叉堆(最小堆, 最大堆)介绍与实现
    C++ 用变量定义数组
    C++ 用变量定义数组
    053185
    053184
    053183
    053182
    053181
    053180
    oracle prior
  • 原文地址:https://www.cnblogs.com/lanzhi/p/6468968.html
Copyright © 2011-2022 走看看