解决方法有两个:

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. HDU2066(SPFA+前向星)

    https://vjudge.net/problem/HDU-2066 虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白 ...

  2. linux如何变更环境变量

    一般有三种方法: 1.直接用export命令: #export PATH=$PATH:/opt/au1200_rm/build_tools/bin 查看是否已经设好,可用命令export查看: 2.修 ...

  3. 洛谷 P2256 一中校运会之百米跑

    题目链接 https://www.luogu.org/problemnew/show/P2256 题目背景 在一大堆秀恩爱的**之中,来不及秀恩爱的苏大学神踏着坚定(?)的步伐走向了100米跑的起点. ...

  4. ftp 传输数据:命令链路连接方法是一样的,而数据链路的建立方法就完全不同

    0.FTP协议有两种工作方式:PORT方式和PASV方式,中文意思为主动式和被动式. PORT(主动)连接过程是:客户端向服务器的FTP端口(默认是21)发送连接请 求,服务器接受连接,建立一条命令链 ...

  5. docker部署rabbitMQ

    获取rabbit镜像: docker pull rabbitmq:management 创建并运行容器: docker run -d --hostname my-rabbit --name rabbi ...

  6. 使用ajax方法实现form表单的提交

    作者:13 GitHub:https://github.com/ZHENFENG13 版权声明:本文为原创文章,未经允许不得转载. 写在前面的话 在使用form表单的时候,一旦点击提交触发submit ...

  7. .net 2.0 使用linq

    .net 2.0 使用linq,主要是使用Linq to Object,没有测试Linq to XML. 方法: 新建一个net2.0的程序,然后添加对System.Core.Dll的引用.引用时vs ...

  8. python之requests

    发送请求 导入 Requests 模块: >>> import requests >>> r = requests.get('https://xxxxxxx.jso ...

  9. curator 分布式锁InterProcessMutex

    写这篇文章的目的主要是为了记录下自己在zookeeper 锁上踩过的坑,以及踩坑之后自己的一点认识; 从zk分布式锁原理说起,原理很简单,大家也应该都知道,简单的说就是zookeeper实现分布式锁是 ...

  10. C_数据结构_递归A函数调用B函数

    # include <stdio.h> int g(int); int f(int); int f(int n) { ) printf("haha\n"); else ...