您的位置:首页 > 其它

VS2005编译器的改进后,有些可能引起内存越界的函数不被推荐了

2005-05-14 00:20 399 查看
char c[10];
strcpy(c, "testtestts"); //ok with VC6, but not in VS2005
strcpy_s(c, _countof(c),"testtestt");//9 chars, ok in VS2005
strcpy_s(c, _countof(c),"testtestte");//10 chars, assert!!!!! in VS2005

and, _countof is a new macro supported in VS2005
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: