Home > Back-end >  Why c primer strcpy part I of this series code at run time is always an error?
Why c primer strcpy part I of this series code at run time is always an error?

Time:12-03

Char \ [80].
Cout & lt; <"Enter the last name:";
Cin & gt;> Temp.
Char * pn=new char [strlen (temp) + 1);
Strcpy (pn, temp);//this section
The return pn;

CodePudding user response:

The error C4996?
Old-fashioned alarm function
Strcpy_s instead,
Or add
# pragma warning (of which: 4996) in the front
  • Related