Hello guys
You rookie here. been trying to run a code but I am getting this weird error that I have not seen before. I have attached a copy of the error and the part of the code it refers to. Thanks for your help
GCard
1>------ Build started: Project: Memory, Configuration: Debug Win32 ------
1>Compiling...
1>memory.cpp
1>c:\documents and settings\myfolder\desktop\mydocs\c\visual\memory\memory.cpp(57) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files\microsoft visual studio 9.0\vc\include\string.h(74) : see declaration of 'strcpy'
1>c:\documents and settings\myfolder\desktop\mydocs\c\visual\memory\memory.cpp(59) : error C2065: 'newchar' : undeclared identifier
1>c:\documents and settings\myfolder\desktop\mydocs\c\visual\memory\memory.cpp(89) : error C2065: 'sSaleperson' : undeclared identifier
1>Build log was saved at "file://c:\Documents and Settingsmyfolder\desktop\mydocs\c\Visual\Memory\Debug\BuildLog.htm"
1>Memory - 2 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
code:
Boolean CSalesRegion::SetDetails(char *psSalesPerson,char *psRegion)
{
if(psSalesPerson==NULL || psRegion==NULL)
{
return FALSE;
}
m_psSalesPerson=new char[strlen(psSalesPerson)+1];
if(m_psSalesPerson==NULL)
{
return FALSE;
}
strcpy(m_psSalesPerson, psSalesPerson);
m_psRegion=newchar[strlen(psRegion)+1];
if(m_psRegion==NULL)
{
return FALSE;
}
strcpy(m_psRegion, psRegion);
return TRUE;
}