https://blog.csdn.net/ochonglangzheo/article/details/8668627# ——windows 下 c++ socket udp 广播
以上程序首先在VS2017下进行了编译,但没有成功,编译报错。后来在VS2013下建立了新windows32控制台应用从程序,编译通过。
编译发送端消息程序时,sprintf报错。(error C4996: 'sprintf': )
参考下面文章进行了解决
https://blog.csdn.net/ture_dream/article/details/64135425 ——Visual Studio 2013 编译错误【error C4996: 'sprintf': This function or variable may be unsafe. 】的解决方案
采用了方法二的第二种方案。