在VS2013上运行一个简单程序时,出现了error C4996: 'swprintf': swprintf has been changed to conform with the ISO C standard, adding an extra character count parameter. To use traditional Microsoft swprintf, set _CRT_NON_CONFORMING_SWPRINTFS.的错误。由错误信息可以知道swprintf函数的问题,在MSDN上查询得到该函数的申明

int swprintf(
wchar_t *buffer,
size_t count,
const wchar_t *format [,
argument]...
);

且有下面这段话:

“swprintf 符合 ISO C 标准,需要 size_t 类型的第二个参数,即count。 若要强制进行早期非标准行为,请定义_CRT_NON_CONFORMING_SWPRINTFS。 在将来的版本中,旧行为可能移除,因此,应更改代码以使用新的一致性行为。”

在原来出错语句:swprintf(szTip, _T("计时:%d"), i);

修改为:swprintf(szTip, 100,_T("计时:%d"), i);

即添加了count参数后就正确了。

error C4996: 'swprintf': swprintf has been changed to conform with the ISO C standard,set _CRT_NON_CONFORMING_SWPRINT的更多相关文章

  1. swprintf has been changed to conform with the ISO C standard, adding an extra character count parameter.

    'swprintf': swprintf has been changed to conform with the ISO C standard, adding an extra character ...

  2. vs2012 error c4996: This function or variable may be unsafe

    编译lua源码时,使用vs2012,遇到如下错误. 1>------ 已启动生成: 项目: 20130925, 配置: Debug Win32 ------ 1>  stdafx.cpp ...

  3. 配置OpenCV产生flann\logger.h(66): error C4996: 'fopen': This function or variable may be unsafe问题[zz]

    使用vs2012/2013配置opencv编译出现问题: 1>------ 已启动生成: 项目: Win32ForOpenCV245, 配置: Debug Win32 ------ 1> ...

  4. 1 error C4996: 'pcl::SAC_SAMPLE_SIZE':

    使用PCL1.8   中使用粗配准拼接 错误 1 error C4996: 'pcl::SAC_SAMPLE_SIZE': This map is deprecated and is kept onl ...

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

    vs2013中错误提示信息: error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s ...

  6. VS2013-解决error C4996: 'fopen'问题

    VS2013中如何解决error C4996: 'fopen'问题 初次使用vs系列编辑器编写控制台应用程序时常出现如下错误: error C4996: 'fopen': This function ...

  7. 【转】VS2013中如何解决error C4996: 'fopen'问题

    原文网址:http://jingyan.baidu.com/article/ce436649fd61543773afd32e.html 今天编写控制台应用程序时出现如下错误 error C4996: ...

  8. error C4996 The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name

    error C4996: 'strupr': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ co ...

  9. error C4996: 'strcpy': This function or variable may be unsafe.

    vs2012用strcpy遇到的错误. 错误描述:error C4996: 'strcpy': This function or variable may be unsafe. Consider us ...

随机推荐

  1. java中读取特殊文件的类型

    java中读取特殊文件的类型: 第一种方法(字符拼接读取): public static String getType(String s){ String s1=s.substring(s.index ...

  2. libviso中的姿态解算【转载】

    这篇关于libviso的文章,本人已投稿在泡泡机器人微信公众号中,放到这里,作学习笔记用. libviso一直以来被称为在视觉里程计(VO)中的老牌开源算法.它通过corner,chessboard两 ...

  3. 【Java基础】反射机制

    反射 反射可以使我们很方便的创建灵活的代码,这些代码可以在运行时装配,无需在组件之间进行源代码链接.反射允许我们在编写和执行时,使我们的代码能够接入装载到JVM中的类的内部信息,而不是源代码中选定的类 ...

  4. EFDB 基本规范&知识

    public abstract class AccountRole //这是继承类型 { [Key] public int ID { get; set; } public bool isDisable ...

  5. java读取和写入txt文件

    package com.yinghuo.testDES; import java.io.BufferedReader;import java.io.BufferedWriter;import java ...

  6. 《深入理解Java虚拟机》学习笔记之内存回收

    垃圾收集(Garbage Collection,GC)并不是Java语言的半生产物,事实上GC历史远比Java久远,真正使用内存动态分配和垃圾收集技术的语言是诞生于1960年的Lisp语言.经过半个世 ...

  7. li点击弹出序号

    <body> <ul> <li>test1</li> <li>test2</li> <li>test3</li ...

  8. CLR查找和加载程序集的方式(二) 流程图

    在前一篇文章<CLR查找和加载程序集的方式(一)>中详细介绍了CLR查找和加载程序的方式,分别介绍了配置与代码的实现方式. 本篇通过一个具体的流程图来帮助大家更加直观明了深入的掌握CLR查 ...

  9. VS2010在网络共享目录使用IntelliSense、ipch、sdf和SQL Compact Server相关问题

    Microsoft SQL Compact Server 是专用于 Visual Studio 的单机SQL 数据库.数据库文件名的后缀为SDF. 而VS2010 拒绝在网络共享目录中建立和打开SDF ...

  10. spring切面编程AOP 范例一

    参照网上的spring AOP编程实例进行配置,但是碰到了几个坑.这篇文章重点讲解一下我踩过的两个坑: 1.使用@Service自动装配的时候,基础扫描包配置要正确: 2.xml中切面配置中的exec ...