解决方法有两个:

1. 在预编译头文件stdafx.h里(在没有include任何头文件之前)定义下面的宏:

#define _CRT_SECURE_NO_DEPRECATE

2. 将sprintf函数替换为sprintf_s函数

VS2013编译报错error C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.的更多相关文章

  1. : error C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

    打开项目----项目属性---配置属性----C/C++ ----预处理器----预处理定义,添加_CRT_SECURE_NO_WARNINGS

  2. 错误 1 error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. d:\users\vs2013\le

    #define _CRT_SECURE_NO_WARNINGS#include<stdio.h>#include<stdlib.h>void main(){    int nu ...

  3. 错误 1 error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use . See online help for details.

    出现这种警告的原因是因为我们没有使用安全的字符串处理函数.如果想屏蔽这种警告,可以使用: 还可以使用其它的方法,参考: https://www.cnblogs.com/gb2013/archive/2 ...

  4. error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation

    遇到这个问题,请打开项目的Properties(属性)------->Configuration Properties(配置属性)------>C/C++ ------>Prepro ...

  5. error C4996: 'sprintf': This function or variable may be unsafe.

    error C4996: 'sprintf': This function or variable may be unsafe.   error C4996: 'sprintf': This func ...

  6. VS 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案

    在VS中编译 C 语言项目,如果使用了 scanf 函数,编译时便会提示如下错误: error C4996: 'scanf': This function or variable may be uns ...

  7. Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案

    在VS 2012 中编译 C 语言项目,如果使用了 scanf 函数,编译时便会提示如下错误: error C4996: 'scanf': This function or variable may ...

  8. [转]Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案

    原文地址:http://www.cnblogs.com/gb2013/archive/2013/03/05/SecurityEnhancementsInTheCRT.html 在VS 2012 中编译 ...

  9. Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案(转载)

    转载:http://www.th7.cn/Program/c/201303/127343.shtml 原因是Visual C++ 2012 使用了更加安全的 run-time library rout ...

随机推荐

  1. spring,springmvc,mybatis整合ssm框架出现ORA-02289:序列不存在问题

    今天整合了一个SSM项目,完了后部署到Tomcat服务器,正常启动.但是当我发送请求时,报错,,如下 报错说序列不存在,可是我明明创建了序列呀,然后我测试了一下,测试语句:select tb_user ...

  2. 【Codeforces 696D】Legen...

    Codeforces 696 D 题意:给\(n\)个串,每个串有一个权值\(a_i\),现在要构造一个长度为\(l\leq 10^{14}\)的串,如果其中包含了第\(i\)个串,则会得到\(a_i ...

  3. kubernetes中infra容器的理解

    1. infra容器和用户容器的关系 1.1 pause 是k8s的基础设施的一部分,pod中其他容器通过pause容器跟其他pod进行通信. 1.2 pod中其他容器跟pause容器共享命名空间1. ...

  4. Subversion 1.8.9 ( SVN Client ) 安装最新版本的svn客户端

    For CentOS7 Users: [WandiscoSVN] name=Wandisco SVN Repo baseurl=http://opensource.wandisco.com/cento ...

  5. java JDK安装教程

    JAVA_HOME G:\JDK\java7\jdk1.7.0_80    根据自己的哈     ;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin 然后找到CLASSPATH ...

  6. HihoCoder1192 简单的树嵌入 dfs、构造

    题目传送门:http://hihocoder.com/problemset/problem/1192 大意:给出一棵$N$个点的树,边权为$1$,要求给每个点构造$M$个权值$v_1...v_M$,使 ...

  7. ListView 控件和 INotifyPropertyChanged 接口

    原文:ListView 控件和 INotifyPropertyChanged 接口 ListView 控件和 DataGridView 控件 ListView 是跟 Winform 中 DataGri ...

  8. 设计模式-简单工厂Coding+jdk源码解析

    感谢慕课geely老师的设计模式课程,本套设计模式的所有内容均以课程为参考. 前面的软件设计七大原则,目前只有理论这块,因为最近参与项目重构,暂时没有时间把Coding的代码按照设计思路一点点写出来. ...

  9. Luogu P1494 [国家集训队]小Z的袜子

    比较简单的莫队题,主要是为了熟练板子. 先考虑固定区间时我们怎么计算,假设区间\([l,r]\)内颜色为\(i\)的袜子有\(cnt_i\)只,那么对于颜色\(i\)来说,凑齐一双的情况个数为: \( ...

  10. 【Qt】窗口居中显示

    w.move((a.desktop()->width() - w.width())/, (a.desktop()->height() - w.height())/); 上述方法可以置中,但 ...