C++ 'strcpy' gives a Warning (C4996)

前端 未结 9 1127
孤城傲影
孤城傲影 2020-12-03 08:15

I am getting this warning but all functions working properly .

what does this really means?

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


        
9条回答
  •  眼角桃花
    2020-12-03 08:27

    There is actualy a way to avoid this warning, still use strcpy, and be safe:

    You can enable the secure template overloads. They will (if possible) deduce the lengths of the buffers used by capturing them with templated overloads. It's a mystery to me why this is not enabled by default in Visual C++.

提交回复
热议问题