{"id":20539,"date":"2024-11-19T08:25:06","date_gmt":"2024-11-19T00:25:06","guid":{"rendered":"https:\/\/fwq.ai\/blog\/20539\/"},"modified":"2024-11-19T08:25:06","modified_gmt":"2024-11-19T00:25:06","slug":"vscode%e6%80%8e%e6%a0%b7%e8%bf%90%e8%a1%8cc%e8%af%ad%e8%a8%80","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/20539\/","title":{"rendered":"vscode\u600e\u6837\u8fd0\u884cc\u8bed\u8a00"},"content":{"rendered":"<blockquote><p>\n  \u5728 vscode \u4e2d\u8fd0\u884c c \u8bed\u8a00\u7a0b\u5e8f\u7684\u6b65\u9aa4\uff1a\u5b89\u88c5 c\/c++ \u6269\u5c55\u3002\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a\u201cmain.c\u201d\u7684 c \u8bed\u8a00\u6587\u4ef6\u3002\u8f93\u5165 c \u8bed\u8a00\u4ee3\u7801\u3002\u914d\u7f6e\u201ctasks.json\u201d\u6587\u4ef6\u4ee5\u7f16\u8bd1 c \u8bed\u8a00\u4ee3\u7801\u3002\u8fd0\u884c\u201cbuild\u201d\u4efb\u52a1\u4ee5\u7f16\u8bd1\u548c\u8fd0\u884c\u7a0b\u5e8f\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/03\/2024040304361734475.jpg\" class=\"aligncenter\" title=\"vscode\u600e\u6837\u8fd0\u884cc\u8bed\u8a00\u63d2\u56fe\" alt=\"vscode\u600e\u6837\u8fd0\u884cc\u8bed\u8a00\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5728 VSCode \u4e2d\u8fd0\u884c C \u8bed\u8a00\u7a0b\u5e8f<\/strong><\/p>\n<p><strong>\u6b65\u9aa4 1\uff1a\u5b89\u88c5\u6269\u5c55<\/strong><\/p>\n<ul>\n<li>\u6253\u5f00 VSCode\uff0c\u8f6c\u5230\u201c\u6269\u5c55\u201d\u9009\u9879\u5361\u3002<\/li>\n<li>\u641c\u7d22\u201cC\/C++\u201d\u6269\u5c55\uff0c\u7136\u540e\u5355\u51fb\u201c\u5b89\u88c5\u201d\u6309\u94ae\u3002<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4 2\uff1a\u521b\u5efa C \u8bed\u8a00\u6587\u4ef6<\/strong><\/p>\n<ul>\n<li>\u6253\u5f00 VSCode\uff0c\u5355\u51fb\u201c\u6587\u4ef6\u201d&gt;\u201c\u65b0\u5efa\u201d\uff0c\u7136\u540e\u9009\u62e9\u201c\u6587\u4ef6\u201d\u3002<\/li>\n<li>\u5c06\u6587\u4ef6\u547d\u540d\u4e3a\u201cmain.c\u201d\u3002<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4 3\uff1a\u7f16\u5199 C \u8bed\u8a00\u4ee3\u7801<\/strong><\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<ul>\n<li>\u5728\u201cmain.c\u201d\u6587\u4ef6\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/li>\n<\/ul>\n<pre>#include &lt;stdio.h&gt;\n\nint main() {\n  printf(\"Hello, world!\n\");\n  return 0;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 4\uff1a\u914d\u7f6e\u4efb\u52a1<\/strong><\/p>\n<ul>\n<li>\u5355\u51fb VSCode \u5de6\u4e0b\u89d2\u7684\u201c\u4efb\u52a1\u201d\u9009\u9879\u5361\u3002<\/li>\n<li>\u53f3\u952e\u5355\u51fb\u7a7a\u767d\u533a\u57df\u5e76\u9009\u62e9\u201c\u521b\u5efa\u4efb\u52a1\u201d\u3002<\/li>\n<li>\u5728\u51fa\u73b0\u7684\u201ctasks.json\u201d\u6587\u4ef6\u4e2d\uff0c\u7c98\u8d34\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/li>\n<\/ul>\n<pre>{\n  \"version\": \"2.0.0\",\n  \"tasks\": [\n    {\n      \"label\": \"build\",\n      \"type\": \"shell\",\n      \"command\": \"gcc ${file}\"\n    }\n  ]\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 5\uff1a\u8fd0\u884c\u7a0b\u5e8f<\/strong><\/p>\n<ul>\n<li>\u5355\u51fb\u201c\u4efb\u52a1\u201d\u9009\u9879\u5361\u4e2d\u7684\u201cbuild\u201d\u4efb\u52a1\u3002<\/li>\n<li>VSCode \u5c06\u7f16\u8bd1 C \u8bed\u8a00\u4ee3\u7801\u5e76\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/li>\n<li>\u5728\u201c\u7ec8\u7aef\u201d\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/li>\n<\/ul>\n<pre>.\/main<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u8fd0\u884c C \u8bed\u8a00\u7a0b\u5e8f\u5e76\u6253\u5370\u8f93\u51fa\u201cHello, world!\u201d\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u6837\u8fd0\u884cc\u8bed\u8a00\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 vscode \u4e2d\u8fd0\u884c c \u8bed\u8a00\u7a0b\u5e8f\u7684\u6b65\u9aa4\uff1a\u5b89\u88c5 c\/c++ \u6269\u5c55\u3002\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a\u201cmain.c\u201d\u7684 c \u8bed\u8a00\u6587\u4ef6\u3002\u8f93\u5165 c \u8bed\u8a00\u4ee3\u7801\u3002\u914d\u7f6e\u201ctasks.json\u201d\u6587\u4ef6\u4ee5\u7f16\u8bd1 c \u8bed\u8a00\u4ee3\u7801\u3002\u8fd0\u884c\u201cbuild\u201d\u4efb\u52a1\u4ee5\u7f16\u8bd1\u548c\u8fd0\u884c\u7a0b\u5e8f\u3002 \u5728 VSCode \u4e2d\u8fd0\u884c C \u8bed\u8a00\u7a0b\u5e8f \u6b65\u9aa4 1\uff1a\u5b89\u88c5\u6269\u5c55 \u6253\u5f00 VSCode\uff0c\u8f6c\u5230\u201c\u6269\u5c55\u201d\u9009\u9879\u5361\u3002 \u641c\u7d22\u201cC\/C++\u201d\u6269\u5c55\uff0c\u7136\u540e\u5355\u51fb\u201c\u5b89\u88c5\u201d\u6309\u94ae\u3002 \u6b65\u9aa4 2\uff1a\u521b\u5efa C \u8bed\u8a00\u6587\u4ef6 \u6253\u5f00 VSCode\uff0c\u5355\u51fb\u201c\u6587\u4ef6\u201d&gt;\u201c\u65b0\u5efa\u201d\uff0c\u7136\u540e\u9009\u62e9\u201c\u6587\u4ef6\u201d\u3002 \u5c06\u6587\u4ef6\u547d\u540d\u4e3a\u201cmain.c\u201d\u3002 \u6b65\u9aa4 3\uff1a\u7f16\u5199 C \u8bed\u8a00\u4ee3\u7801 \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u5728\u201cmain.c\u201d\u6587\u4ef6\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a #include &lt;stdio.h&gt; int main() { printf(&#8220;Hello, world! &#8220;); return 0; } \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa4 4\uff1a\u914d\u7f6e\u4efb\u52a1 \u5355\u51fb VSCode \u5de6\u4e0b\u89d2\u7684\u201c\u4efb\u52a1\u201d\u9009\u9879\u5361\u3002 \u53f3\u952e\u5355\u51fb\u7a7a\u767d\u533a\u57df\u5e76\u9009\u62e9\u201c\u521b\u5efa\u4efb\u52a1\u201d\u3002 \u5728\u51fa\u73b0\u7684\u201ctasks.json\u201d\u6587\u4ef6\u4e2d\uff0c\u7c98\u8d34\u4ee5\u4e0b\u5185\u5bb9\uff1a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-20539","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/20539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=20539"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/20539\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=20539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=20539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=20539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}