strcpy() error in Visual studio 2012

后端 未结 7 900
Happy的楠姐
Happy的楠姐 2021-02-06 12:50

so I have this code:

#include \"stdafx.h\"
#include 
#include 
#include 
using namespace std;

...<

7条回答
  •  时光说笑
    2021-02-06 13:20

    A quick fix is to add the _CRT_SECURE_NO_WARNINGS definition to your project's settings

    Right-click your C++ and chose the "Properties" item to get to the properties window.

    Now follow and expand to, "Configuration Properties"->"C/C++"->"Preprocessor"->"Preprocessor definitions".

    In the "Preprocessor definitions" add

    _CRT_SECURE_NO_WARNINGS

    but it would be a good idea to add

    _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)

    as to inherit predefined definitions

    IMHO & for the most part this is a good approach.

提交回复
热议问题