Доброго времени суток, друзья!
Спешу всех поздравить с прошедшим Рождеством и поменьше вам проблем в профессиональном и личном планах!
У меня такой вопрос: почему первый вариант в коде, приведенном ниже, работает, второй нет? У кого какие идеи? Заранее спасибо!
| Код | #include <string.h> #include <stdlib.h> #include <stdio.h> #include <errno.h>
int main( void ) { // это работает char s_str[100]; strcpy_s(s_str, "hello "); strcat_s(s_str, "_");
// это не работает char *d_str = new char[100]; // 'strcpy_s' : function does not take 2 arguments strcpy_s(d_str, "hello "); // 'strcat_s' : function does not take 2 arguments strcat_s(d_str, "_");
delete[] d_str; }
|
| Цитата | Append a string. These are versions of strcat, wcscat, _mbscat with security enhancements as described in Security Enhancements in the CRT. errno_t strcat_s( char *strDestination, size_t sizeInByte, const char *strSource ); ...
|
|