我收到警告:
warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead.
To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
F:\vuStudio\VC\include\string.h(188) : see declaration of 'strncpy'
Run Code Online (Sandbox Code Playgroud)
我在stackoverflow.com上阅读这strcpy并不安全,应该strncpy改用。但是现在为什么我要警告strncpy不安全?
我称它为:
strncpy(this->title, title.c_str(), sizeof(this->title));
Run Code Online (Sandbox Code Playgroud) c++ ×1