How to get rid of “unsafe” warnings / errors in Visual Studio (strcpy, sprintf, strdup)

后端 未结 9 1514
臣服心动
臣服心动 2020-12-05 10:43

I\'m trying to get rid of some compiler warnings that say strcpy, sprintf, etc are unsafe. I get why they\'re unsafe, but I can\'t think of a good way to fix the code, in a

9条回答
  •  悲&欢浪女
    2020-12-05 11:04

    as it is suggested in the message, use _CRT_SECURE_NO_WARNINGS to disable this warnings.

    in ProjectProperties -> Configuration Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions, add following macros:

    _CRT_SECURE_NO_WARNINGS

提交回复
热议问题