Home > Back-end >  Visual error appears in 2010 C2660: 'strcpy_s' : the function does not take 2 arguments
Visual error appears in 2010 C2660: 'strcpy_s' : the function does not take 2 arguments

Time:10-14

Appear error C2660: 'strcpy_s' : the function does not take 2 arguments
Strcpy_s cannot use two parameters? How to solve? Where is wrong?
The code is as follows:

Char * name;
Char temname [20].
Cin> Temname;
Name=new char [strlen (temname) + 1);
Strcpy (name, temname);

CodePudding user response:

http://bbs.csdn.net/topics/250036875

CodePudding user response:

#include
#include
Int main (void)
{
Char string [10].
Char * str1="abcdefghi";
Strcpy_s (string, 10, str1);
Printf (" % s \ n ", string);
return 0;
}

Secure strcpy need to specify the address space of the target
  • Related