{"id":86,"date":"2017-09-06T22:52:53","date_gmt":"2017-09-06T16:52:53","guid":{"rendered":"https:\/\/qtvz.com\/?p=86"},"modified":"2017-09-06T22:52:53","modified_gmt":"2017-09-06T16:52:53","slug":"%e5%9c%a8vs2013-%e4%bd%bf%e7%94%a8c%e8%af%ad%e8%a8%80%e5%ba%93%e5%87%bd%e6%95%b0%ef%bc%8c%e5%87%ba%e7%8e%b0%e5%87%ba%e7%8e%b0%e9%94%99%e8%af%af%ef%bc%8c%e6%8f%90%e7%a4%ba%e4%bd%bf%e7%94%a8%e4%b8%8d","status":"publish","type":"post","link":"https:\/\/qtvz.com\/86.html","title":{"rendered":"\u5728VS2013 \u4f7f\u7528C\u8bed\u8a00\u5e93\u51fd\u6570\uff0c\u51fa\u73b0\u51fa\u73b0\u9519\u8bef\uff0c\u63d0\u793a\u4f7f\u7528\u4e0d\u5b89\u5168\u51fd\u6570USE _CRT_SECURE_NO_WARNINGS"},"content":{"rendered":"<!--wp-compress-html--><!--wp-compress-html no compression--><p>\u5728VS 2013 \u4e2d\u7f16\u8bd1 C \u8bed\u8a00\u9879\u76ee\uff0c\u5982\u679c\u4f7f\u7528\u4e86 scanf \u51fd\u6570\uff0c\u7f16\u8bd1\u65f6\u4fbf\u4f1a\u63d0\u793a\u5982\u4e0b\u9519\u8bef\uff1a<\/p>\n<pre class=\"lang:default decode:true\">error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead.\r\n To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.<\/pre>\n<p>\u539f\u56e0\u662fVisual C++ 2012 \u4f7f\u7528\u4e86\u66f4\u52a0\u5b89\u5168\u7684 run-time library routines \u3002\u65b0\u7684Security CRT functions\uff08\u5c31\u662f\u90a3\u4e9b\u5e26\u6709\u201c_s\u201d\u540e\u7f00\u7684\u51fd\u6570\uff09\uff0c\u8bf7\u53c2\u89c1\uff1a<\/p>\n<h3>\u300aCRT\u51fd\u6570\u7684\u5b89\u5168\u589e\u5f3a\u7684\u7248\u672c\u300b<\/h3>\n<p>\u4e0b\u9762\u7ed9\u51fa\u8fd9\u4e2a\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<p>\u65b9\u6cd5\u4e00\uff1a\u5c06\u539f\u6765\u7684\u65e7\u51fd\u6570\u66ff\u6362\u6210\u65b0\u7684 Security CRT functions\u3002<\/p>\n<p>\u65b9\u6cd5\u4e8c\uff1a\u7528\u4ee5\u4e0b\u65b9\u6cd5\u5c4f\u853d\u8fd9\u4e2a\u8b66\u544a\uff1a<\/p>\n<p>1. \u5728\u9884\u7f16\u8bd1\u5934\u6587\u4ef6stdafx.h\u91cc\uff08\u6ce8\u610f\uff1a\u4e00\u5b9a\u8981\u5728\u6ca1\u6709include\u4efb\u4f55\u5934\u6587\u4ef6\u4e4b\u524d\uff09\u5b9a\u4e49\u4e0b\u9762\u7684\u5b8f\uff1a<\/p>\n<p><strong>#define _CRT_SECURE_NO_DEPRECATE<\/strong><\/p>\n<p>2. \u6216\u58f0\u660e\u00a0<strong>#param warning(disable:4996)<\/strong><\/p>\n<p>3. \u66f4\u6539\u9884\u5904\u7406\u5b9a\u4e49\uff1a<\/p>\n<p>\u9879\u76ee-&gt;\u5c5e\u6027-&gt;\u914d\u7f6e\u5c5e\u6027-&gt;C\/C++ -&gt; \u9884\u5904\u7406\u5668 -&gt; \u9884\u5904\u7406\u5668\u5b9a\u4e49\uff0c\u589e\u52a0\uff1a<\/p>\n<p><strong>_CRT_SECURE_NO_DEPRECATE<\/strong><\/p>\n<!--wp-compress-html no compression--><!--wp-compress-html-->","protected":false},"excerpt":{"rendered":"\u5728VS 2013 \u4e2d\u7f16\u8bd1 C \u8bed\u8a00\u9879\u76ee\uff0c\u5982\u679c\u4f7f\u7528\u4e86 scanf \u51fd\u6570\uff0c\u7f16\u8bd1\u65f6\u4fbf\u4f1a\u63d0\u793a\u5982\u4e0b\u9519\u8bef\uff1a error C4996: &#8216;scanf&#8217;: This function or variable may  \u00b7\u00b7\u00b7","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[12,4],"tags":[],"views":10647,"_links":{"self":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts\/86"}],"collection":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/comments?post=86"}],"version-history":[{"count":1,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts\/86\/revisions"}],"predecessor-version":[{"id":87,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/posts\/86\/revisions\/87"}],"wp:attachment":[{"href":"https:\/\/qtvz.com\/api\/wp\/v2\/media?parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/categories?post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qtvz.com\/api\/wp\/v2\/tags?post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}