{"id":21401,"date":"2024-11-19T11:41:16","date_gmt":"2024-11-19T03:41:16","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21401\/"},"modified":"2024-11-19T11:41:16","modified_gmt":"2024-11-19T03:41:16","slug":"vscode%e6%80%8e%e4%b9%88%e8%bf%90%e8%a1%8cc%e8%af%ad%e8%a8%80","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21401\/","title":{"rendered":"vscode\u600e\u4e48\u8fd0\u884cc\u8bed\u8a00"},"content":{"rendered":"<blockquote><p>\n  \u8981\u4f7f\u7528 visual studio code (vscode) \u8fd0\u884c c \u8bed\u8a00\u7a0b\u5e8f\uff0c\u4f60\u9700\u8981\uff1a\u5b89\u88c5 c\/c++ \u548c code runner \u6269\u5c55\u3002\u521b\u5efa c \u8bed\u8a00\u9879\u76ee\u5e76\u7f16\u5199\u4ee3\u7801\u3002\u914d\u7f6e c\/c++ \u4efb\u52a1\u4ee5\u6307\u5b9a\u7f16\u8bd1\u5668\u548c\u8fd0\u884c\u9009\u9879\u3002\u901a\u8fc7 f5 \u6216\u201crun\u201d\u6309\u94ae\u7f16\u8bd1\u5e76\u8fd0\u884c\u7a0b\u5e8f\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/27\/2024052714422192044.jpg\" class=\"aligncenter\" title=\"vscode\u600e\u4e48\u8fd0\u884cc\u8bed\u8a00\u63d2\u56fe\" alt=\"vscode\u600e\u4e48\u8fd0\u884cc\u8bed\u8a00\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728 Visual Studio Code \u4e2d\u8fd0\u884c C \u8bed\u8a00\u7a0b\u5e8f<\/strong><\/p>\n<p>\u8981\u4f7f\u7528 Visual Studio Code (VSCode) \u8fd0\u884c C \u8bed\u8a00\u7a0b\u5e8f\uff0c\u4f60\u9700\u8981\uff1a<\/p>\n<p><strong>\u6b65\u9aa4 1\uff1a\u5b89\u88c5\u5fc5\u8981\u7684\u6269\u5c55<\/strong><\/p>\n<ul>\n<li>C\/C++ \u6269\u5c55\uff1a\u6b64\u6269\u5c55\u63d0\u4f9b C\/C++ \u8bed\u8a00\u652f\u6301\u548c IntelliSense\u3002<\/li>\n<li>Code Runner \u6269\u5c55\uff1a\u6b64\u6269\u5c55\u5141\u8bb8\u4f60\u5728 IDE \u4e2d\u8fd0\u884c\u4ee3\u7801\u3002<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4 2\uff1a\u521b\u5efa C \u8bed\u8a00\u9879\u76ee<\/strong><\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<ul>\n<li>\u6253\u5f00 VSCode \u5e76\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6587\u4ef6\u5939\u3002<\/li>\n<li>\u5728\u6587\u4ef6\u5939\u4e2d\uff0c\u53f3\u952e\u5355\u51fb\u5e76\u9009\u62e9\u201cNew File\u201d\u3002\u7136\u540e\uff0c\u4e3a\u4f60\u7684 C \u8bed\u8a00\u7a0b\u5e8f\u547d\u540d\uff08\u4f8b\u5982\uff0cmain.c\uff09\u3002<\/li>\n<li>\u5728 main.c \u6587\u4ef6\u4e2d\uff0c\u8f93\u5165\u4f60\u7684\u4ee3\u7801\u3002<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4 3\uff1a\u914d\u7f6e\u8fd0\u884c\u73af\u5883<\/strong><\/p>\n<ul>\n<li>\u5728 VSCode \u4e2d\uff0c\u6309 Ctrl+Shift+P \u6253\u5f00\u547d\u4ee4\u9762\u677f\u3002<\/li>\n<li>\u952e\u5165\u201cTasks: Configure Task\u201d\u5e76\u9009\u62e9\u8be5\u9009\u9879\u3002<\/li>\n<li>\u9009\u62e9\u201cC\/C++: clang compile and run active file\u201d\u4efb\u52a1\u3002<\/li>\n<li>\u5728\u201cCommand\u201d\u5b57\u6bb5\u4e2d\uff0c\u8f93\u5165 clang\u3002<\/li>\n<li>\u5728\u201cArguments\u201d\u5b57\u6bb5\u4e2d\uff0c\u8f93\u5165 $(file)\u3002<\/li>\n<li>\u5728\u201cOptions\u201d\u90e8\u5206\u4e2d\uff0c\u9009\u4e2d\u201cRun in Terminal\u201d\u590d\u9009\u6846\u3002<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4 4\uff1a\u7f16\u8bd1\u548c\u8fd0\u884c C \u8bed\u8a00\u7a0b\u5e8f<\/strong><\/p>\n<ul>\n<li>\u5728 VSCode \u4e2d\uff0c\u6253\u5f00 main.c \u6587\u4ef6\u3002<\/li>\n<li>\u6309 F5 \u6216\u5355\u51fb\u5de5\u5177\u680f\u4e0a\u7684\u201cRun\u201d\u6309\u94ae\u3002<\/li>\n<li>VSCode \u5c06\u7f16\u8bd1\u4f60\u7684\u7a0b\u5e8f\u5e76\u8f93\u51fa\u7ed3\u679c\u3002<\/li>\n<\/ul>\n<p><strong>\u63d0\u793a\uff1a<\/strong><\/p>\n<ul>\n<li>\u786e\u4fdd\u4f60\u7684 C \u8bed\u8a00\u7a0b\u5e8f\u5df2\u6b63\u786e\u7f16\u5199\u5e76\u6ca1\u6709\u8bed\u6cd5\u9519\u8bef\u3002<\/li>\n<li>\u5982\u679c\u51fa\u73b0\u9519\u8bef\uff0c\u8bf7\u68c0\u67e5\u4f60\u7684\u4ee3\u7801\u5e76\u6839\u636e\u9519\u8bef\u4fe1\u606f\u8fdb\u884c\u66f4\u6b63\u3002<\/li>\n<li>\u4f60\u53ef\u4ee5\u81ea\u5b9a\u4e49\u4efb\u52a1\u914d\u7f6e\u4ee5\u6ee1\u8db3\u4f60\u7684\u7279\u5b9a\u9700\u6c42\uff0c\u4f8b\u5982\u8bbe\u7f6e\u7f16\u8bd1\u6807\u5fd7\u6216\u6307\u5b9a\u5176\u4ed6\u7f16\u8bd1\u5668\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u8fd0\u884c\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>\u8981\u4f7f\u7528 visual studio code (vscode) \u8fd0\u884c c \u8bed\u8a00\u7a0b\u5e8f\uff0c\u4f60\u9700\u8981\uff1a\u5b89\u88c5 c\/c++ \u548c code runner \u6269\u5c55\u3002\u521b\u5efa c \u8bed\u8a00\u9879\u76ee\u5e76\u7f16\u5199\u4ee3\u7801\u3002\u914d\u7f6e c\/c++ \u4efb\u52a1\u4ee5\u6307\u5b9a\u7f16\u8bd1\u5668\u548c\u8fd0\u884c\u9009\u9879\u3002\u901a\u8fc7 f5 \u6216\u201crun\u201d\u6309\u94ae\u7f16\u8bd1\u5e76\u8fd0\u884c\u7a0b\u5e8f\u3002 \u5982\u4f55\u5728 Visual Studio Code \u4e2d\u8fd0\u884c C \u8bed\u8a00\u7a0b\u5e8f \u8981\u4f7f\u7528 Visual Studio Code (VSCode) \u8fd0\u884c C \u8bed\u8a00\u7a0b\u5e8f\uff0c\u4f60\u9700\u8981\uff1a \u6b65\u9aa4 1\uff1a\u5b89\u88c5\u5fc5\u8981\u7684\u6269\u5c55 C\/C++ \u6269\u5c55\uff1a\u6b64\u6269\u5c55\u63d0\u4f9b C\/C++ \u8bed\u8a00\u652f\u6301\u548c IntelliSense\u3002 Code Runner \u6269\u5c55\uff1a\u6b64\u6269\u5c55\u5141\u8bb8\u4f60\u5728 IDE \u4e2d\u8fd0\u884c\u4ee3\u7801\u3002 \u6b65\u9aa4 2\uff1a\u521b\u5efa C \u8bed\u8a00\u9879\u76ee \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u6253\u5f00 VSCode \u5e76\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6587\u4ef6\u5939\u3002 \u5728\u6587\u4ef6\u5939\u4e2d\uff0c\u53f3\u952e\u5355\u51fb\u5e76\u9009\u62e9\u201cNew [&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-21401","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21401","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=21401"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21401\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}