MS strncpy_s的替代品 [英] Alternatives to MS strncpy_s

查看:64
本文介绍了MS strncpy_s的替代品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Microsoft安全增强功能有哪些替代方法,例如 strncpy_s _itoa_s ?尽管在MS环境中进行开发,但目标是编写可以轻松移植到其他平台的代码。

What are some alternatives to the Microsoft security enhanced functions such as strncpy_s or _itoa_s? Although developing in MS environment the goal is to write code that could be ported easily to other platforms.

推荐答案

Rageous是正确的,在那里

Rageous is correct, there is no complex logic behind it.

我现在只使用Microsoft的版本,如果您以后决定移植到另一个操作系统,则可以自己为目标平台实现它,使用预处理程序命令来指定您在非Windows平台上的实现。

I would just use Microsoft's version for now and if you decide to port to another OS later, THEN implement it yourself for the target platform and use preprocessor commands to specify your implementation on the non-Windows platform(s).

这篇关于MS strncpy_s的替代品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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