Difference between 'strcpy' and 'strcpy_s'?

前端 未结 2 1645
隐瞒了意图╮
隐瞒了意图╮ 2020-11-30 09:45

When i tries to use strcpy to copy a string it gave me a compile error.

error C4996 \'strcpy\': This function or variable may be unsafe.
         


        
2条回答
  •  日久生厌
    2020-11-30 10:40

    I'd like to add that if you ever try to compile other people's code, MS will always complain about unsafe functions in the standard library. Just define _CRT_SECURE_NO_WARNINGS like the error message tells you to and MSVC will work like any other compiler.

提交回复
热议问题