alunlee

There is a waring in my application:

warning C4995:: “wcscpy”: 名 被 #pragma deprecated

warning C4996: “wcscpy”被 明 否 的

It happend here:

wcscpy(mName, L"");

Although there is no error , i still want to know the reason.




Re: Visual C++ General warning C4995

Jonathan Caves - MSFT

The funciton strcpy (and its siblings like wcscpy) are unsafe as they do not include the size of the target buffer and so it is very easy to overrun the target buffer. You should use strcpy_s or wcscpy_s instread




Re: Visual C++ General warning C4995

alunlee

Thanks a lot!