strcpy_s是C ++标准的一部分吗?或仅是MS Visual C ++的一部分 [英] Is strcpy_s part of the C++ Standard? Or only part of MS Visual C++

查看:264
本文介绍了strcpy_s是C ++标准的一部分吗?或仅是MS Visual C ++的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MS Visual Studio中使用函数strcpy会给我一个错误,提示我应该使用更安全的strcpy_s. strcpy_s是C ++标准的一部分吗?还是仅是Microsoft Visual C ++的一部分?

Using the function strcpy in MS Visual Studio gives me an error saying I should use strcpy_s which is safer to use. Is strcpy_s part of the C++ standard? Or is it only part of Microsoft Visual C++?

包含strcpy_s的代码是否只能在Visual Studio中编译?

Will code containing strcpy_s only compile in Visual Studio?

推荐答案

strcpy_s()是C11的可选部分(更正式地称为条件功能".允许实现不实现标准化的边界检查接口"在附件K中.

strcpy_s() is an optional part of C11 (more formally called a "conditional feature". Implementations are permitted to not implement the "Bounds-checking interfaces" standardized in Annex K.

C11的其他一些条件特征包括:

Some other conditional features of C11 include:

  • 原子
  • 复杂类型
  • 线程
  • 可变长度数组(对此有趣的是,VLA在C99中不是可选的)

这篇关于strcpy_s是C ++标准的一部分吗?或仅是MS Visual C ++的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆