安全,可移植的char数组功能? [英] Secure ,Portable char array functions ?

查看:77
本文介绍了安全,可移植的char数组功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,

是否有适用于MSVC ++函数的标准/便携式等效函数,例如:strncpy_s(),strcpy_s(),_ stricmp(),strcat_s(),sprintf_s(),fopen_s()等.


我正在将VC6应用程序移植到VC8,并获得有关非安全功能的警告音.我想用安全功能代替非安全功能.但是,到目前为止,我还没有找到一种便携式解决方案.我希望将便携式解决方案作为我的应用程序的一部分.与Unix连接,而其他人则与Windows连接.

预先表示感谢.



Is there a standard/Portable equivalent functions for MSVC++ functions like : strncpy_s(), strcpy_s(), _stricmp(), strcat_s(), sprintf_s(), fopen_s() etc.


I am porting a VC6 application to VC8, and getting tones of warnings regarding non-secure functions. I want to replace the non-secure functions with secure ones. But, till now i have not been able to find a portable solutions. I want a portable solution as some part of my app. connects with unix while others with windows.

Thanks in advance.

推荐答案

C ++的可移植方式是使用标准C ++库类std::stringstd::wstring或可能的std::vector<char>std::vector<wchar_t>使用std::copy_nstd::find等标准算法...
欢呼声,
AR
The C++ portable way is the use of the Standard C++ Library classes std::string and std::wstring or possibly std::vector<char> and std::vector<wchar_t> with Standard algorithms as std::copy_n, std::find etc...
cheers,
AR


请参见此处 [
See here[^] for a possible solution.


这篇关于安全,可移植的char数组功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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