This commit is contained in:
Aurorxa 2024-08-11 05:41:10 +00:00
parent 88e1705b37
commit 2d96cf748e
19 changed files with 57 additions and 53 deletions

View File

@ -8,7 +8,7 @@
<meta name="generator" content="VitePress v1.3.2">
<link rel="preload stylesheet" href="/c/assets/style.8enJ9bsK.css" as="style">
<script type="module" src="/c/assets/app.DS7FIVmo.js"></script>
<script type="module" src="/c/assets/app.DOv65PSF.js"></script>
<link rel="preload" href="/c/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
<link rel="shortcut icon" href="/c//logo.svg">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,shrink-to-fit=no">
@ -18,7 +18,7 @@
</head>
<body>
<div id="app"></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DynzO91I\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DEs09TjE\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
</body>
</html>

View File

@ -1 +1 @@
import{R as p}from"./chunks/theme.BqwVBBaA.js";import{U as o,a7 as u,a8 as c,a9 as l,aa as f,ab as d,ac as m,ad as h,ae as g,af as A,ag as y,d as P,u as v,y as w,x as C,ah as R,ai as b,aj as E,a5 as S}from"./chunks/framework.CZRoMP2i.js";function i(e){if(e.extends){const a=i(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const s=i(p),T=P({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=v();return w(()=>{C(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&R(),b(),E(),s.setup&&s.setup(),()=>S(s.Layout)}});async function j(){globalThis.__VITEPRESS__=!0;const e=D(),a=x();a.provide(c,e);const t=l(e.route);return a.provide(f,t),a.component("Content",d),a.component("ClientOnly",m),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),s.enhanceApp&&await s.enhanceApp({app:a,router:e,siteData:h}),{app:a,router:e,data:t}}function x(){return g(T)}function D(){let e=o,a;return A(t=>{let n=y(t),r=null;return n&&(e&&(a=n),(e||a===n)&&(n=n.replace(/\.js$/,".lean.js")),r=import(n)),o&&(e=!1),r},s.NotFound)}o&&j().then(({app:e,router:a,data:t})=>{a.go().then(()=>{u(a.route,t.site),e.mount("#app")})});export{j as createApp};
import{R as p}from"./chunks/theme.CfoaGUmH.js";import{U as o,a7 as u,a8 as c,a9 as l,aa as f,ab as d,ac as m,ad as h,ae as g,af as A,ag as y,d as P,u as v,y as w,x as C,ah as R,ai as b,aj as E,a5 as S}from"./chunks/framework.CZRoMP2i.js";function i(e){if(e.extends){const a=i(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const s=i(p),T=P({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=v();return w(()=>{C(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&R(),b(),E(),s.setup&&s.setup(),()=>S(s.Layout)}});async function j(){globalThis.__VITEPRESS__=!0;const e=D(),a=x();a.provide(c,e);const t=l(e.route);return a.provide(f,t),a.component("Content",d),a.component("ClientOnly",m),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),s.enhanceApp&&await s.enhanceApp({app:a,router:e,siteData:h}),{app:a,router:e,data:t}}function x(){return g(T)}function D(){let e=o,a;return A(t=>{let n=y(t),r=null;return n&&(e&&(a=n),(e||a===n)&&(n=n.replace(/\.js$/,".lean.js")),r=import(n)),o&&(e=!1),r},s.NotFound)}o&&j().then(({app:e,router:a,data:t})=>{a.go().then(()=>{u(a.route,t.site),e.mount("#app")})});export{j as createApp};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
var kt=Object.defineProperty;var Ft=(a,e,t)=>e in a?kt(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var Ce=(a,e,t)=>Ft(a,typeof e!="symbol"?e+"":e,t);import{X as Ot,s as ne,v as Ve,ak as Rt,al as Ct,d as Mt,G as be,am as et,h as ye,an as At,ao as Lt,x as Dt,ap as zt,y as Me,R as de,Q as we,aq as Pt,ar as jt,Y as Vt,U as $t,a1 as Bt,o as Q,b as Wt,j as x,a2 as Kt,k as D,as as Jt,at as Ut,au as qt,c as Z,n as tt,e as _e,E as st,F as nt,a as he,t as fe,av as Gt,p as Qt,l as Ht,aw as it,a4 as Yt,aa as Zt,ag as Xt,ax as es,_ as ts}from"./framework.CZRoMP2i.js";import{u as ss,c as ns}from"./theme.BqwVBBaA.js";const is={root:()=>Ot(()=>import("./@localSearchIndexroot.Nu76qxxq.js"),[])};/*!
var kt=Object.defineProperty;var Ft=(a,e,t)=>e in a?kt(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var Ce=(a,e,t)=>Ft(a,typeof e!="symbol"?e+"":e,t);import{X as Ot,s as ne,v as Ve,ak as Rt,al as Ct,d as Mt,G as be,am as et,h as ye,an as At,ao as Lt,x as Dt,ap as zt,y as Me,R as de,Q as we,aq as Pt,ar as jt,Y as Vt,U as $t,a1 as Bt,o as Q,b as Wt,j as x,a2 as Kt,k as D,as as Jt,at as Ut,au as qt,c as Z,n as tt,e as _e,E as st,F as nt,a as he,t as fe,av as Gt,p as Qt,l as Ht,aw as it,a4 as Yt,aa as Zt,ag as Xt,ax as es,_ as ts}from"./framework.CZRoMP2i.js";import{u as ss,c as ns}from"./theme.CfoaGUmH.js";const is={root:()=>Ot(()=>import("./@localSearchIndexroot.DzLCot_b.js"),[])};/*!
* tabbable 6.2.0
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
*/var vt=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Ie=vt.join(","),mt=typeof Element>"u",re=mt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ne=!mt&&Element.prototype.getRootNode?function(a){var e;return a==null||(e=a.getRootNode)===null||e===void 0?void 0:e.call(a)}:function(a){return a==null?void 0:a.ownerDocument},ke=function a(e,t){var s;t===void 0&&(t=!0);var n=e==null||(s=e.getAttribute)===null||s===void 0?void 0:s.call(e,"inert"),r=n===""||n==="true",i=r||t&&e&&a(e.parentNode);return i},rs=function(e){var t,s=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return s===""||s==="true"},gt=function(e,t,s){if(ke(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(Ie));return t&&re.call(e,Ie)&&n.unshift(e),n=n.filter(s),n},bt=function a(e,t,s){for(var n=[],r=Array.from(e);r.length;){var i=r.shift();if(!ke(i,!1))if(i.tagName==="SLOT"){var o=i.assignedElements(),c=o.length?o:i.children,l=a(c,!0,s);s.flatten?n.push.apply(n,l):n.push({scopeParent:i,candidates:l})}else{var h=re.call(i,Ie);h&&s.filter(i)&&(t||!e.includes(i))&&n.push(i);var f=i.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(i),v=!ke(f,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(i));if(f&&v){var b=a(f===!0?i.children:f.children,!0,s);s.flatten?n.push.apply(n,b):n.push({scopeParent:i,candidates:b})}else r.unshift.apply(r,i.children)}}return n},yt=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ie=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||rs(e))&&!yt(e)?0:e.tabIndex},as=function(e,t){var s=ie(e);return s<0&&t&&!yt(e)?0:s},os=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},wt=function(e){return e.tagName==="INPUT"},cs=function(e){return wt(e)&&e.type==="hidden"},ls=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(s){return s.tagName==="SUMMARY"});return t},us=function(e,t){for(var s=0;s<e.length;s++)if(e[s].checked&&e[s].form===t)return e[s]},ds=function(e){if(!e.name)return!0;var t=e.form||Ne(e),s=function(o){return t.querySelectorAll('input[type="radio"][name="'+o+'"]')},n;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")n=s(window.CSS.escape(e.name));else try{n=s(e.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var r=us(n,e.form);return!r||r===e},hs=function(e){return wt(e)&&e.type==="radio"},fs=function(e){return hs(e)&&!ds(e)},ps=function(e){var t,s=e&&Ne(e),n=(t=s)===null||t===void 0?void 0:t.host,r=!1;if(s&&s!==e){var i,o,c;for(r=!!((i=n)!==null&&i!==void 0&&(o=i.ownerDocument)!==null&&o!==void 0&&o.contains(n)||e!=null&&(c=e.ownerDocument)!==null&&c!==void 0&&c.contains(e));!r&&n;){var l,h,f;s=Ne(n),n=(l=s)===null||l===void 0?void 0:l.host,r=!!((h=n)!==null&&h!==void 0&&(f=h.ownerDocument)!==null&&f!==void 0&&f.contains(n))}}return r},rt=function(e){var t=e.getBoundingClientRect(),s=t.width,n=t.height;return s===0&&n===0},vs=function(e,t){var s=t.displayCheck,n=t.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var r=re.call(e,"details>summary:first-of-type"),i=r?e.parentElement:e;if(re.call(i,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="legacy-full"){if(typeof n=="function"){for(var o=e;e;){var c=e.parentElement,l=Ne(e);if(c&&!c.shadowRoot&&n(c)===!0)return rt(e);e.assignedSlot?e=e.assignedSlot:!c&&l!==e.ownerDocument?e=l.host:e=c}e=o}if(ps(e))return!e.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return rt(e);return!1},ms=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var s=0;s<t.children.length;s++){var n=t.children.item(s);if(n.tagName==="LEGEND")return re.call(t,"fieldset[disabled] *")?!0:!n.contains(e)}return!0}t=t.parentElement}return!1},Fe=function(e,t){return!(t.disabled||ke(t)||cs(t)||vs(t,e)||ls(t)||ms(t))},$e=function(e,t){return!(fs(t)||ie(t)<0||!Fe(e,t))},gs=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},bs=function a(e){var t=[],s=[];return e.forEach(function(n,r){var i=!!n.scopeParent,o=i?n.scopeParent:n,c=as(o,i),l=i?a(n.candidates):o;c===0?i?t.push.apply(t,l):t.push(o):s.push({documentOrder:r,tabIndex:c,item:n,isScope:i,content:l})}),s.sort(os).reduce(function(n,r){return r.isScope?n.push.apply(n,r.content):n.push(r.content),n},[]).concat(t)},ys=function(e,t){t=t||{};var s;return t.getShadowRoot?s=bt([e],t.includeContainer,{filter:$e.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:gs}):s=gt(e,t.includeContainer,$e.bind(null,t)),bs(s)},ws=function(e,t){t=t||{};var s;return t.getShadowRoot?s=bt([e],t.includeContainer,{filter:Fe.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):s=gt(e,t.includeContainer,Fe.bind(null,t)),s},ae=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return re.call(e,Ie)===!1?!1:$e(t,e)},_s=vt.concat("iframe").join(","),Ae=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return re.call(e,_s)===!1?!1:Fe(t,e)};/*!

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,11 @@
import{_ as s,c as a,o as i,a6 as n}from"./chunks/framework.CZRoMP2i.js";const l="/c/assets/1.D60Zf6_d.png",e="/c/assets/2.D2-G6nV2.png",p="/c/assets/3.DpzkVk5V.png",t="/c/assets/4.BXk95GIP.png",r="/c/assets/5.CbWTB08W.png",c="/c/assets/6.twO9TCIg.png",h="/c/assets/7.CKOjeIvS.png",d="/c/assets/8.DKmR0CxE.png",o="/c/assets/9.Cudf77_s.gif",k="/c/assets/10.BBUUlhRC.png",u="/c/assets/11.iLABkB7O.png",g="/c/assets/12.BQuYWOU9.png",b="/c/assets/13.CslpH6j0.png",m="/c/assets/14.BAyvZdKq.png",C="/c/assets/15.C3oC1iUd.png",E="/c/assets/16.Ds-jsEZn.png",F="/c/assets/17.Cd37gMYs.png",y="/c/assets/18.CAw2z3gc.png",_="/c/assets/19.DdPThnr-.png",v="/c/assets/20.q_rvlDnY.png",B="/c/assets/21.JRHg9RZA.png",f="/c/assets/22.Baq-Hb06.png",A="/c/assets/23.c1ht53mu.png",x="/c/assets/24.CAZmH5Py.png",D="/c/assets/25.DWeCYBe9.png",q="/c/assets/26.2XM8pYni.png",w="/c/assets/27.CN0t-fuo.png",S="/c/assets/28.AcDh3LXQ.png",L="/c/assets/29.CUkDFAc6.png",P="/c/assets/30.picNTNaJ.png",W="/c/assets/31.DKX92RgJ.png",T="/c/assets/32.Bxr7QKI3.png",M="/c/assets/33.DuFWsOgW.png",U="/c/assets/34.Da9qUcfr.png",R="/c/assets/35.7_gEABSX.gif",O="/c/assets/36.C2KQYoVC.gif",N="/c/assets/37.RTUP8Vtx.png",I="/c/assets/38.Dq21DxwL.png",V="/c/assets/39.QmpUaNxU.png",G="/c/assets/40.DP0C29gZ.png",X="/c/assets/41.DwzHokd4.png",$="/c/assets/42.Bi6K26yA.png",H="/c/assets/43.Bw8DcEQ_.png",K="/c/assets/44.DPc8Z9rS.png",Q="/c/assets/45.S84xHMTl.png",j="/c/assets/46.iw3JQUkn.png",Y="/c/assets/47.ILeJt-HK.png",J="/c/assets/48.CHgm7khh.png",Z="/c/assets/49.N1nqJaEg.png",z="/c/assets/50.DHsnibMi.png",ss="/c/assets/51.BQr6Q0uV.png",as="/c/assets/52.BVemi2Lh.png",is="/c/assets/53.BHR69UXx.png",ns="/c/assets/54.CPSU5SJI.png",ls="/c/assets/55.CaQLoDlw.png",es="/c/assets/56.aRGy4XbL.png",ps="/c/assets/57.kNO9fmPR.png",ts="/c/assets/58.D4EkoC4o.png",rs="/c/assets/59.V23Lo9e_.png",cs="/c/assets/60.Du9LVeMB.png",hs="/c/assets/61.DdFg75U9.png",ds="/c/assets/62.C6bz6KtT.png",os="/c/assets/63.CB6LAhB5.png",ks="/c/assets/64.Bip8bkua.png",us="/c/assets/65.DRNHRduW.png",gs="/c/assets/66.Cth4qqEn.png",bs="/c/assets/67.DWGWZ64P.png",ms="/c/assets/68.3hDIDdvx.png",Cs="/c/assets/69.Bw_dQ4ap.png",Es="/c/assets/70.Cn_ubTyA.png",Fs="/c/assets/71.C84EBqwB.png",ys="/c/assets/72.dZfJY4eR.png",_s="/c/assets/73.B0zm0Z79.png",vs="/c/assets/74.CaTcEy1Q.png",Bs="/c/assets/75.iEc8mo9g.png",fs="/c/assets/76.Co2KxM6t.png",As="/c/assets/77.CaUm8Qhc.png",xs="/c/assets/78.kOkqIKG6.png",Ds="/c/assets/79.CyeASH-c.png",qs="/c/assets/80.CFdk60La.png",ws="/c/assets/81.Bhl-0uK_.png",Ss="/c/assets/82.Dni9KbXV.png",Ls="/c/assets/83.BXx10MCV.png",Ps="/c/assets/84.CXcIKX1T.png",Ws="/c/assets/85.CQ3_QCQT.png",Ts="/c/assets/86.CQoDRJM5.gif",Ms="/c/assets/87.CPfwZvD9.gif",Us="/c/assets/88.bxEomEjU.gif",Rs="/c/assets/89.C_onhf2k.png",Os="/c/assets/90.Budj3s38.gif",Ns="/c/assets/91.CH8koQdu.gif",Is="/c/assets/92.kUJhxMtg.png",Vs="/c/assets/93.BJeJJW4_.png",Gs="/c/assets/94.BCuK6eJL.gif",Xs="/c/assets/95.rKC-z4z-.gif",$s="/c/assets/96.BJE3xxuT.gif",Hs="/c/assets/97.DJOq__O0.gif",Ks="/c/assets/98.BDt_0fRR.png",Qs="/c/assets/99.Bo5OawW8.png",js="/c/assets/100.sUWUfl5e.png",Ys="/c/assets/101.BK4jpnB8.png",Js="/c/assets/102.EF8vdbSq.png",Zs="/c/assets/103.DjxdA_Co.png",zs="/c/assets/104.sp68q1hh.gif",sa="/c/assets/105.DhMRyxNN.gif",aa="/c/assets/106.CdcLZM0R.gif",ia="/c/assets/107.D-5AsTTr.png",na="/c/assets/108.2RQKmAUa.png",la="/c/assets/109.CI4xX8SM.png",ea="/c/assets/110.C8QUZ9v3.gif",pa="/c/assets/111.g5tQfhWz.gif",ta="/c/assets/112.CX0_1NsE.gif",ra="/c/assets/113.BrFJeoK6.png",ca="/c/assets/114.58TjSSjH.gif",ha="/c/assets/115.CgqNV2hL.png",da="/c/assets/116.BasYWvkM.png",oa="/c/assets/117.CjFxJpBr.png",ka="/c/assets/118.Dm5Jspvp.gif",ua="/c/assets/119.1krCh8cy.gif",ga="/c/assets/120.DOSyahv7.gif",ba="/c/assets/121.BHEvX_FI.gif",ma="/c/assets/122.DFA0g1_d.gif",Ca="/c/assets/123.D50nO5eA.gif",Ea="/c/assets/124.cAvG1Qfq.png",Fa="/c/assets/125.DpakQFWz.gif",ya="/c/assets/126.Bg61j9QI.gif",_a="/c/assets/127.DPvD9UCw.gif",va="/c/assets/128.Ceu65U_n.gif",Ba="/c/assets/129.BWPFRK_8.gif",fa="/c/assets/130.Ct4TfxPf.gif",Aa="/c/assets/131.zsKtx_jV.png",xa="/c/assets/132.3oqDAW0w.png",Da="/c/assets/133.D9TSeAa9.gif",qa="/c/assets/134.CCRgYIVq.png",wa="/c/assets/135.C1t2T6FV.gif",Sa="/c/assets/136.Rqa4uHq6.png",La="/c/assets/137.6yQYnjOa.gif",Pa="/c/assets/138.hYR9GiiD.gif",Wa="/c/assets/139.D3b-QIrA.gif",Ta="/c/assets/140.DGbA6qsW.gif",Ma="/c/assets/141.BToOkxf2.gif",Ua="/c/assets/142.C3wekjfY.png",Ra="/c/assets/143.CKuuzuQ_.png",Oa="/c/assets/144.B4r6Nv14.gif",Na="/c/assets/145.CvbhuZNK.png",Ia="/c/assets/146.BPgYm4ZX.gif",Va="/c/assets/147.DH2fri13.gif",Ga="/c/assets/148.CDDIqy03.gif",Xa="/c/assets/149.DCQsqYYC.gif",$a="/c/assets/150.CUjMoXNF.gif",Ha="/c/assets/151.BWbajkuB.gif",Ka="/c/assets/152.C1JnBDr7.png",Qa="/c/assets/153.DwN2p3bo.png",ja="/c/assets/154.DdSfz-Pf.gif",Ya="/c/assets/155.BMocjVt7.gif",Ja="/c/assets/156.BUU-wlaw.gif",Za="/c/assets/157.ssadIF0D.gif",za="/c/assets/158.Dq5lLq9v.gif",si="/c/assets/159.CJ0_loZ8.gif",ai="/c/assets/160.BPOK9irZ.gif",ii="/c/assets/161.B1eB55rC.gif",ni="/c/assets/162.VIcU-hkN.gif",li="/c/assets/163.BM9viRZJ.gif",ei="/c/assets/164.DpMBA1SK.gif",pi="/c/assets/165.DgXuU6LF.png",ti="/c/assets/166.Dnw73s2h.gif",ri="/c/assets/167.SnFXRSaL.png",ci="/c/assets/168.DnoEqOjV.png",hi="/c/assets/169.BJBdn7pw.png",di="/c/assets/170.DXtQWYsM.gif",oi="/c/assets/171.hcERTQkN.gif",ki="/c/assets/172.CioraEUv.png",ui="/c/assets/173.kWHWwnc_.png",Ai=JSON.parse('{"title":"第一章:开发环境的安装和配置(⭐)","description":"","frontmatter":{},"headers":[],"relativePath":"notes/01_c-basic/01_xdx/index.md","filePath":"notes/01_c-basic/01_xdx/index.md","lastUpdated":1723194975000}'),gi={name:"notes/01_c-basic/01_xdx/index.md"},bi=n('<h1 id="第一章-开发环境的安装和配置-⭐" tabindex="-1">第一章:开发环境的安装和配置(⭐) <a class="header-anchor" href="#第一章-开发环境的安装和配置-⭐" aria-label="Permalink to &quot;第一章:开发环境的安装和配置(⭐)&quot;"></a></h1><h2 id="_1-1-环境的安装和配置" tabindex="-1">1.1 环境的安装和配置 <a class="header-anchor" href="#_1-1-环境的安装和配置" aria-label="Permalink to &quot;1.1 环境的安装和配置&quot;"></a></h2><h3 id="_1-1-1-概述" tabindex="-1">1.1.1 概述 <a class="header-anchor" href="#_1-1-1-概述" aria-label="Permalink to &quot;1.1.1 概述&quot;"></a></h3><ul><li>要开发 C/C++ 程序,需要安装 C/C++ 编译器,目前有两种主流实现,即: <ul><li>GCCGNU Compiler Collection全平台实现即支持 Windows、MacOS、Linux 等。</li><li>MSVCMicrosoft Visual C++):只支持 Windows 系统。</li></ul></li><li>GCC 在 Windows 上的版本有很多,如:<a href="https://www.mingw-w64.org/" target="_blank" rel="noreferrer">MinGW-w64</a>、<a href="https://cygwin.com/" target="_blank" rel="noreferrer">Gygwin</a>、<a href="https://www.msys2.org/" target="_blank" rel="noreferrer">MSYS2</a>。它们之间的区别,如下所示:</li></ul><table tabindex="0"><thead><tr><th>特性</th><th>MinGW-w64</th><th>Cygwin</th><th>MSYS2</th></tr></thead><tbody><tr><td><strong>简介</strong></td><td>Minimalist GNU for Windows</td><td>POSIX 兼容环境和工具集</td><td>结合了 MinGW 和 Cygwin 的工具集</td></tr><tr><td><strong>编译器</strong></td><td>提供 GCC 编译器</td><td>提供 POSIX 兼容环境,包含大量工具</td><td>提供 MinGW-w64 工具链和 Cygwin 环境</td></tr><tr><td><strong>生成文件</strong></td><td>Windows 原生可执行文件</td><td>POSIX 兼容的可执行文件</td><td>可以生成 Windows 原生可执行文件或 POSIX 文件</td></tr><tr><td><strong>依赖</strong></td><td>无需额外依赖</td><td>依赖 Cygwin DLL</td><td>根据使用工具链决定MinGW-w64 无依赖Cygwin 有依赖)</td></tr><tr><td><strong>工具和库</strong></td><td>基本的编译工具</td><td>丰富的 Unix 工具和库</td><td>丰富的工具和库,强大的包管理系统</td></tr><tr><td><strong>性能</strong></td><td>性能较好</td><td>可能较低,因为通过兼容层调用系统</td><td>取决于使用的工具链MinGW-w64 性能较好)</td></tr><tr><td><strong>复杂度</strong></td><td>简单易用</td><td>设置和使用相对复杂</td><td>较为灵活,复杂度介于 MinGW-w64 和 Cygwin 之间</td></tr><tr><td><strong>适用场景</strong></td><td>开发 Windows 原生应用</td><td>运行和开发 Unix 程序</td><td>混合使用 Unix 工具和开发 Windows 原生应用</td></tr><tr><td><strong>优点</strong></td><td>轻量级,直接生成 Windows 应用</td><td>完整的 POSIX 兼容环境,丰富的工具</td><td>灵活的环境,强大的包管理系统</td></tr><tr><td><strong>缺点</strong></td><td>工具和库较少</td><td>生成文件依赖 Cygwin DLL性能可能较低</td><td>环境较大,占用更多空间,复杂性比 MinGW-w64 高</td></tr></tbody></table><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① MinGW-w64 、Cygwin 以及 MSYS2 任选其一安装即可。</li><li>② 目前的 Win10 和 Win11 版本支持 WSL2 Windows Sub Linux 2 ,即 Windows 的子系统 Linux可以实现在 Windows 系统上安装一个 Linux ,然后再运行 Linux 中的 GCC 工具链。</li></ul></div><h3 id="_1-1-2-mingw-w64-的安装和配置" tabindex="-1">1.1.2 MinGW-w64 的安装和配置 <a class="header-anchor" href="#_1-1-2-mingw-w64-的安装和配置" aria-label="Permalink to &quot;1.1.2 MinGW-w64 的安装和配置&quot;"></a></h3><h4 id="_1-1-2-1-安装" tabindex="-1">1.1.2.1 安装 <a class="header-anchor" href="#_1-1-2-1-安装" aria-label="Permalink to &quot;1.1.2.1 安装&quot;"></a></h4><ul><li>下载到本地:略。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>下载地址在<a href="https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-posix-seh-ucrt-rt_v11-rev1.7z" target="_blank" rel="noreferrer">这里</a>。</p></div><p><img src="'+l+'" alt=""></p><ul><li>解压到指定的目录,即:</li></ul><p><img src="'+e+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>本人的解压目录是:<code>D:\\develop\\mingw64</code> 。</p></div><h4 id="_1-1-2-2-配置-path-环境变量" tabindex="-1">1.1.2.2 配置 path 环境变量 <a class="header-anchor" href="#_1-1-2-2-配置-path-环境变量" aria-label="Permalink to &quot;1.1.2.2 配置 path 环境变量&quot;"></a></h4><ul><li>配置环境变量,以便任意目录都可以执行 gcc 命令,即:</li></ul><p><img src="'+p+'" alt=""></p><p><img src="'+t+'" alt=""></p><p><img src="'+r+'" alt=""></p><p><img src="'+c+'" alt=""></p><p><img src="'+h+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>因为,本人安装 MinGW-w64 的目录是 <code>D:\\develop\\mingw64</code>,所以配置 path 环境变量就需要 <code>D:\\develop\\mingw64\\bin</code>。</p></div><p><img src="'+d+'" alt=""></p><ul><li>测试是否安装成功:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --version</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+o+'" alt=""></p><h3 id="_1-1-3-cygwin-的安装和配置" tabindex="-1">1.1.3 Cygwin 的安装和配置 <a class="header-anchor" href="#_1-1-3-cygwin-的安装和配置" aria-label="Permalink to &quot;1.1.3 Cygwin 的安装和配置&quot;"></a></h3><h4 id="_1-1-3-1-安装" tabindex="-1">1.1.3.1 安装 <a class="header-anchor" href="#_1-1-3-1-安装" aria-label="Permalink to &quot;1.1.3.1 安装&quot;"></a></h4><ul><li>下载到本地:略。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>下载地址在<a href="https://www.cygwin.com/install.html" target="_blank" rel="noreferrer">这里</a>。</p></div><p><img src="'+k+'" alt=""></p><ul><li>点击安装:</li></ul><p><img src="'+u+'" alt=""></p><p><img src="'+g+'" alt=""></p><p><img src="'+b+'" alt=""></p><p><img src="'+m+'" alt=""></p><p><img src="'+C+'" alt=""></p><p><img src="'+E+'" alt=""></p><p><img src="'+F+'" alt=""></p><p><img src="'+y+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>默认是最小化安装,没有 GCC需要选择 gcc-core、gcc-g++、make、gdb、binutils 。</p></div><p><img src="'+_+'" alt=""></p><p><img src="'+v+'" alt=""></p><p><img src="'+B+'" alt=""></p><p><img src="'+f+'" alt=""></p><p><img src="'+A+'" alt=""></p><p><img src="'+x+'" alt=""></p><p><img src="'+D+'" alt=""></p><p><img src="'+q+'" alt=""></p><p><img src="'+w+'" alt=""></p><h4 id="_1-1-3-2-配置-path-环境变量" tabindex="-1">1.1.3.2 配置 path 环境变量 <a class="header-anchor" href="#_1-1-3-2-配置-path-环境变量" aria-label="Permalink to &quot;1.1.3.2 配置 path 环境变量&quot;"></a></h4><ul><li>和 <code>3.1.2.2 配置 path 环境变量</code> 步骤相同:略。</li></ul><h3 id="_1-1-4-msys2-推荐" tabindex="-1">1.1.4 MSYS2推荐 <a class="header-anchor" href="#_1-1-4-msys2-推荐" aria-label="Permalink to &quot;1.1.4 MSYS2推荐&quot;"></a></h3><h4 id="_1-1-4-1-安装" tabindex="-1">1.1.4.1 安装 <a class="header-anchor" href="#_1-1-4-1-安装" aria-label="Permalink to &quot;1.1.4.1 安装&quot;"></a></h4><ul><li>下载到本地:略。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>下载地址在<a href="https://www.msys2.org/" target="_blank" rel="noreferrer">这里</a>。</p></div><p><img src="'+S+'" alt=""></p><ul><li>点击安装:</li></ul><p><img src="'+L+'" alt=""></p><p><img src="'+P+'" alt=""></p><p><img src="'+W+'" alt=""></p><p><img src="'+T+'" alt=""></p><p><img src="'+M+'" alt=""></p><ul><li>出现命令终端:</li></ul><p><img src="'+U+'" alt=""></p><ul><li>替换清华镜像源(可选):</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sed</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -i</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;s#https\\?://mirror.msys2.org/#https://mirrors.tuna.tsinghua.edu.cn/msys2/#g&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /etc/pacman.d/mirrorlist</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">*</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+R+'" alt=""></p><ul><li>安装 gcc 等相关开发包:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pacman</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -Syu</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --noconfirm</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # 更新包管理器</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pacman</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -Sy</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> base-devel</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --noconfirm</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # 安装开发工具包</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pacman</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -Sy</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> mingw-w64-x86_64-toolchain</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --noconfirm</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # 安装开发 gcc 相关工具链</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+O+'" alt=""></p><h4 id="_1-1-4-2-配置-path-环境变量" tabindex="-1">1.1.4.2 配置 path 环境变量 <a class="header-anchor" href="#_1-1-4-2-配置-path-环境变量" aria-label="Permalink to &quot;1.1.4.2 配置 path 环境变量&quot;"></a></h4><ul><li>和 <code>3.1.2.2 配置 path 环境变量</code> 步骤相同:略。</li></ul><h2 id="_1-2-ide-的安装和配置" tabindex="-1">1.2 IDE 的安装和配置 <a class="header-anchor" href="#_1-2-ide-的安装和配置" aria-label="Permalink to &quot;1.2 IDE 的安装和配置&quot;"></a></h2><h3 id="_1-2-1-clion" tabindex="-1">1.2.1 CLion <a class="header-anchor" href="#_1-2-1-clion" aria-label="Permalink to &quot;1.2.1 CLion&quot;"></a></h3><h4 id="_1-2-1-1-概述" tabindex="-1">1.2.1.1 概述 <a class="header-anchor" href="#_1-2-1-1-概述" aria-label="Permalink to &quot;1.2.1.1 概述&quot;"></a></h4><ul><li><a href="https://www.jetbrains.com/clion/" target="_blank" rel="noreferrer">CLion</a> 是一款由 JetBrains 推出的跨平台 C/C++ 集成开发环境IDE它具有智能编辑器、CMake 构建支持、调试器、单元测试、代码分析等功能,可以极大提高 C/C++ 开发效率。</li></ul><h4 id="_1-2-1-2-安装" tabindex="-1">1.2.1.2 安装 <a class="header-anchor" href="#_1-2-1-2-安装" aria-label="Permalink to &quot;1.2.1.2 安装&quot;"></a></h4><ul><li>鼠标双击,进入安装:</li></ul><p><img src="'+N+'" alt=""></p><ul><li>下一步:</li></ul><p><img src="'+I+'" alt=""></p><ul><li>下一步:</li></ul><p><img src="'+V+'" alt=""></p><ul><li>下一步:</li></ul><p><img src="'+G+'" alt=""></p><ul><li>安装:</li></ul><p><img src="'+X+'" alt=""></p><ul><li>安装完成:</li></ul><p><img src="'+$+'" alt=""></p><h4 id="_1-2-1-3-配置" tabindex="-1">1.2.1.3 配置 <a class="header-anchor" href="#_1-2-1-3-配置" aria-label="Permalink to &quot;1.2.1.3 配置&quot;"></a></h4><ul><li>打开 CLion </li></ul><p><img src="'+H+'" alt=""></p><ul><li>安装中文插件(可选):</li></ul><p><img src="'+K+'" alt=""></p><p><img src="'+Q+'" alt=""></p><ul><li>配置新 UI </li></ul><p><img src="'+j+'" alt=""></p><p><img src="'+Y+'" alt=""></p><ul><li>新 UI 配置自定义字体(可选):</li></ul><p><img src="'+J+'" alt=""></p><ul><li>配置<code>自动保存</code>功能:</li></ul><p><img src="'+Z+'" alt=""></p><ul><li>配置<code>文件编码</code> 为 UTF-8</li></ul><p><img src="'+z+'" alt=""></p><ul><li>配置<code>控制台编码</code>为 UTF-8</li></ul><p><img src="'+ss+'" alt=""></p><ul><li>配置<code>显示方法分隔符</code>功能:</li></ul><p><img src="'+as+'" alt=""></p><ul><li>配置<code>编辑器</code>的字体(可选):</li></ul><p><img src="'+is+'" alt=""></p><ul><li>检测 GCC 工具链是否安装成功:</li></ul><p><img src="'+ns+'" alt=""></p><h3 id="_1-2-2-vs-code" tabindex="-1">1.2.2 VS Code <a class="header-anchor" href="#_1-2-2-vs-code" aria-label="Permalink to &quot;1.2.2 VS Code&quot;"></a></h3><h4 id="_1-2-2-1-概述" tabindex="-1">1.2.2.1 概述 <a class="header-anchor" href="#_1-2-2-1-概述" aria-label="Permalink to &quot;1.2.2.1 概述&quot;"></a></h4><ul><li><a href="https://code.visualstudio.com/" target="_blank" rel="noreferrer">Visual Studio Code (VS Code)</a> 是一个免费的开源代码编辑器,适用于 Windows、MacOS 和 Linux 平台。它支持语法高亮、智能代码补全IntelliSense、内置调试工具和Git集成。用户可以通过扩展来添加更多功能支持新的编程语言、主题和调试工具。VS Code 还支持在微软 Azure 上进行部署和托管,适用于各种编程语言和框架。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>Visual Studio Code 需要安装对应的插件,才能运行 C/C++ 代码。</p></div><h4 id="_1-2-2-2-安装" tabindex="-1">1.2.2.2 安装 <a class="header-anchor" href="#_1-2-2-2-安装" aria-label="Permalink to &quot;1.2.2.2 安装&quot;"></a></h4><ul><li>鼠标双击,进入安装:</li></ul><p><img src="'+ls+'" alt=""></p><ul><li>同意协议:</li></ul><p><img src="'+es+'" alt=""></p><ul><li>下一步:</li></ul><p><img src="'+ps+'" alt=""></p><ul><li>下一步:</li></ul><p><img src="'+ts+'" alt=""></p><ul><li>下一步:</li></ul><p><img src="'+rs+'" alt=""></p><ul><li>安装:</li></ul><p><img src="'+cs+'" alt=""></p><ul><li>安装过程:</li></ul><p><img src="'+hs+'" alt=""></p><ul><li>安装完成:</li></ul><p><img src="'+ds+'" alt=""></p><h4 id="_1-2-2-3-配置" tabindex="-1">1.2.2.3 配置 <a class="header-anchor" href="#_1-2-2-3-配置" aria-label="Permalink to &quot;1.2.2.3 配置&quot;"></a></h4><ul><li>安装<code>中文</code>插件:</li></ul><p><img src="'+os+'" alt=""></p><p><img src="'+ks+'" alt=""></p><ul><li>安装 <code>C/C++</code> 插件:</li></ul><p><img src="'+us+'" alt=""></p><p><img src="'+gs+'" alt=""></p><h3 id="_1-2-3-microsoft-visual-studio" tabindex="-1">1.2.3 Microsoft Visual Studio <a class="header-anchor" href="#_1-2-3-microsoft-visual-studio" aria-label="Permalink to &quot;1.2.3 Microsoft Visual Studio&quot;"></a></h3><h4 id="_1-2-3-1-概述" tabindex="-1">1.2.3.1 概述 <a class="header-anchor" href="#_1-2-3-1-概述" aria-label="Permalink to &quot;1.2.3.1 概述&quot;"></a></h4><ul><li><p><a href="https://visualstudio.microsoft.com/" target="_blank" rel="noreferrer">Visual Studio</a>(简称 VS是由微软公司发布的集成开发环境。它包括了整个软件生命周期中所需要的大部分工具UML工具、代码管控工具、集成开发环境IDE等。</p></li><li><p>Visual Studio 支持 C/C++、C#、F#、VB 等多种程序语言的开发和测试可以用于生成Web应用程序也可以生成桌面应用程序功能十分强大但下载和安装很可能耗时数小时还可能会塞满磁盘。</p></li><li><p>Visual Studio 2022 有三种版本:社区版(免费,不支持企业使用),专业版(第一年 1199 美元/ 799 美元续订)和企业版(第一年 5999 美元/ 2569 美元续订)。企业版拥有面向架构师的功能、高级调试和测试,这些功能是另两种 SKU 所没有的。</p></li><li><p>Visual Studio 旨在成为世界上最好的 IDE集成开发环境目前最新版本为 Visual Studio 2022。</p></li></ul><h4 id="_1-2-3-2-安装" tabindex="-1">1.2.3.2 安装 <a class="header-anchor" href="#_1-2-3-2-安装" aria-label="Permalink to &quot;1.2.3.2 安装&quot;"></a></h4><ul><li>鼠标双击,进入安装:</li></ul><p><img src="'+bs+'" alt=""></p><ul><li>继续:</li></ul><p><img src="'+ms+'" alt=""></p><ul><li>等待:</li></ul><p><img src="'+Cs+'" alt=""></p><ul><li>工作负荷(使用 C++ 的桌面开发):</li></ul><p><img src="'+Es+'" alt=""></p><ul><li>单个组件:</li></ul><p><img src="'+Fs+'" alt=""></p><ul><li>语言包:</li></ul><p><img src="'+ys+'" alt=""></p><ul><li>安装位置(修改默认的安装位置):</li></ul><p><img src="'+_s+'" alt=""></p><ul><li>如果不是第一次安装,可能会出现<code>共享组件、工具和 SDK</code>不可以修改,即:</li></ul><p><img src="'+vs+'" alt=""></p><ul><li>此时,就需要打开<code>注册表编辑器</code>,将如下图中的除了第一个选项,全部删除,然后关闭再重新安装,即:</li></ul><p><img src="'+Bs+'" alt=""></p><ul><li>开始安装:</li></ul><p><img src="'+fs+'" alt=""></p><ul><li>安装中:</li></ul><p><img src="'+As+'" alt=""></p><ul><li>安装完成,然后关闭:</li></ul><p><img src="'+xs+'" alt=""></p><h4 id="_1-2-3-3-配置" tabindex="-1">1.2.3.3 配置 <a class="header-anchor" href="#_1-2-3-3-配置" aria-label="Permalink to &quot;1.2.3.3 配置&quot;"></a></h4><ul><li>在开始菜单处,启动 VS </li></ul><p><img src="'+Ds+'" alt=""></p><ul><li>登录或跳过该选项(有微软账号就注册,没有就暂时跳过):</li></ul><p><img src="'+qs+'" alt=""></p><ul><li>继续:</li></ul><p><img src="'+ws+'" alt=""></p><ul><li>注册 VS </li></ul><p><img src="'+Ss+'" alt=""></p><ul><li>填写注册码:</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① Pro 版本:<code>TD244-P4NB7-YQ6XK-Y8MMM-YWV2J</code></li><li>② Enterprise 版本:<code>VHF9H-NXBBB-638P6-6JHCY-88JWH</code></li></ul></div><p><img src="'+Ls+'" alt=""></p><p><img src="'+Ps+'" alt=""></p><h1 id="第二章-c-语言入门-helloworld-⭐" tabindex="-1">第二章C 语言入门HelloWorld <a class="header-anchor" href="#第二章-c-语言入门-helloworld-⭐" aria-label="Permalink to &quot;第二章C 语言入门HelloWorld&quot;"></a></h1><h2 id="_2-1-手动版" tabindex="-1">2.1 手动版 <a class="header-anchor" href="#_2-1-手动版" aria-label="Permalink to &quot;2.1 手动版&quot;"></a></h2><ul><li>① 新建一个 <code>HelloWorld.c</code> 的文件:</li></ul><p><img src="'+Ws+`" alt=""></p><ul><li>② 通过<code>记事本</code>等软件打开该文件,输入如下的代码,并保存:</li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span></span>
import{_ as s,c as a,o as i,a6 as n}from"./chunks/framework.CZRoMP2i.js";const l="/c/assets/1.D60Zf6_d.png",e="/c/assets/2.D2-G6nV2.png",p="/c/assets/3.DpzkVk5V.png",t="/c/assets/4.BXk95GIP.png",r="/c/assets/5.CbWTB08W.png",c="/c/assets/6.twO9TCIg.png",h="/c/assets/7.CKOjeIvS.png",d="/c/assets/8.DKmR0CxE.png",o="/c/assets/9.Cudf77_s.gif",k="/c/assets/10.BBUUlhRC.png",u="/c/assets/11.iLABkB7O.png",g="/c/assets/12.BQuYWOU9.png",b="/c/assets/13.CslpH6j0.png",m="/c/assets/14.BAyvZdKq.png",E="/c/assets/15.C3oC1iUd.png",C="/c/assets/16.Ds-jsEZn.png",F="/c/assets/17.Cd37gMYs.png",y="/c/assets/18.CAw2z3gc.png",_="/c/assets/19.DdPThnr-.png",v="/c/assets/20.q_rvlDnY.png",B="/c/assets/21.JRHg9RZA.png",f="/c/assets/22.Baq-Hb06.png",A="/c/assets/23.c1ht53mu.png",D="/c/assets/24.CAZmH5Py.png",x="/c/assets/25.DWeCYBe9.png",q="/c/assets/26.2XM8pYni.png",w="/c/assets/27.CN0t-fuo.png",S="/c/assets/28.AcDh3LXQ.png",L="/c/assets/29.CUkDFAc6.png",P="/c/assets/30.picNTNaJ.png",T="/c/assets/31.DKX92RgJ.png",W="/c/assets/32.Bxr7QKI3.png",M="/c/assets/33.DuFWsOgW.png",U="/c/assets/34.Da9qUcfr.png",R="/c/assets/35.7_gEABSX.gif",O="/c/assets/36.C2KQYoVC.gif",I="/c/assets/37.RTUP8Vtx.png",N="/c/assets/38.Dq21DxwL.png",V="/c/assets/39.QmpUaNxU.png",G="/c/assets/40.DP0C29gZ.png",X="/c/assets/41.DwzHokd4.png",$="/c/assets/42.Bi6K26yA.png",H="/c/assets/43.Bw8DcEQ_.png",K="/c/assets/44.DPc8Z9rS.png",Q="/c/assets/45.S84xHMTl.png",j="/c/assets/46.iw3JQUkn.png",Y="/c/assets/47.ILeJt-HK.png",J="/c/assets/48.CHgm7khh.png",Z="/c/assets/49.N1nqJaEg.png",z="/c/assets/50.DHsnibMi.png",ss="/c/assets/51.BQr6Q0uV.png",as="/c/assets/52.BVemi2Lh.png",is="/c/assets/53.BHR69UXx.png",ns="/c/assets/54.CPSU5SJI.png",ls="/c/assets/55.CaQLoDlw.png",es="/c/assets/56.aRGy4XbL.png",ps="/c/assets/57.kNO9fmPR.png",ts="/c/assets/58.D4EkoC4o.png",rs="/c/assets/59.V23Lo9e_.png",cs="/c/assets/60.Du9LVeMB.png",hs="/c/assets/61.DdFg75U9.png",ds="/c/assets/62.C6bz6KtT.png",os="/c/assets/63.CB6LAhB5.png",ks="/c/assets/64.Bip8bkua.png",us="/c/assets/65.DRNHRduW.png",gs="/c/assets/66.Cth4qqEn.png",bs="/c/assets/67.DWGWZ64P.png",ms="/c/assets/68.3hDIDdvx.png",Es="/c/assets/69.Bw_dQ4ap.png",Cs="/c/assets/70.Cn_ubTyA.png",Fs="/c/assets/71.C84EBqwB.png",ys="/c/assets/72.dZfJY4eR.png",_s="/c/assets/73.B0zm0Z79.png",vs="/c/assets/74.CaTcEy1Q.png",Bs="/c/assets/75.iEc8mo9g.png",fs="/c/assets/76.Co2KxM6t.png",As="/c/assets/77.CaUm8Qhc.png",Ds="/c/assets/78.kOkqIKG6.png",xs="/c/assets/79.CyeASH-c.png",qs="/c/assets/80.CFdk60La.png",ws="/c/assets/81.Bhl-0uK_.png",Ss="/c/assets/82.Dni9KbXV.png",Ls="/c/assets/83.BXx10MCV.png",Ps="/c/assets/84.CXcIKX1T.png",Ts="/c/assets/85.CQ3_QCQT.png",Ws="/c/assets/86.CQoDRJM5.gif",Ms="/c/assets/87.CPfwZvD9.gif",Us="/c/assets/88.bxEomEjU.gif",Rs="/c/assets/89.C_onhf2k.png",Os="/c/assets/90.Budj3s38.gif",Is="/c/assets/91.CH8koQdu.gif",Ns="/c/assets/92.kUJhxMtg.png",Vs="/c/assets/93.BJeJJW4_.png",Gs="/c/assets/94.BCuK6eJL.gif",Xs="/c/assets/95.rKC-z4z-.gif",$s="/c/assets/96.BJE3xxuT.gif",Hs="/c/assets/97.DJOq__O0.gif",Ks="/c/assets/98.BDt_0fRR.png",Qs="/c/assets/99.Bo5OawW8.png",js="/c/assets/100.sUWUfl5e.png",Ys="/c/assets/101.BK4jpnB8.png",Js="/c/assets/102.EF8vdbSq.png",Zs="/c/assets/103.DjxdA_Co.png",zs="/c/assets/104.sp68q1hh.gif",sa="/c/assets/105.DhMRyxNN.gif",aa="/c/assets/106.CdcLZM0R.gif",ia="/c/assets/107.D-5AsTTr.png",na="/c/assets/108.2RQKmAUa.png",la="/c/assets/109.CI4xX8SM.png",ea="/c/assets/110.C8QUZ9v3.gif",pa="/c/assets/111.g5tQfhWz.gif",ta="/c/assets/112.CX0_1NsE.gif",ra="/c/assets/113.BrFJeoK6.png",ca="/c/assets/114.58TjSSjH.gif",ha="/c/assets/115.CgqNV2hL.png",da="/c/assets/116.BasYWvkM.png",oa="/c/assets/117.CjFxJpBr.png",ka="/c/assets/118.Dm5Jspvp.gif",ua="/c/assets/119.1krCh8cy.gif",ga="/c/assets/120.DOSyahv7.gif",ba="/c/assets/121.BHEvX_FI.gif",ma="/c/assets/122.DFA0g1_d.gif",Ea="/c/assets/123.D50nO5eA.gif",Ca="/c/assets/124.cAvG1Qfq.png",Fa="/c/assets/125.DpakQFWz.gif",ya="/c/assets/126.Bg61j9QI.gif",_a="/c/assets/127.DPvD9UCw.gif",va="/c/assets/128.Ceu65U_n.gif",Ba="/c/assets/129.BWPFRK_8.gif",fa="/c/assets/130.Ct4TfxPf.gif",Aa="/c/assets/131.zsKtx_jV.png",Da="/c/assets/132.3oqDAW0w.png",xa="/c/assets/133.D9TSeAa9.gif",qa="/c/assets/134.CCRgYIVq.png",wa="/c/assets/135.C1t2T6FV.gif",Sa="/c/assets/136.Rqa4uHq6.png",La="/c/assets/137.6yQYnjOa.gif",Pa="/c/assets/138.hYR9GiiD.gif",Ta="/c/assets/139.D3b-QIrA.gif",Wa="/c/assets/140.DGbA6qsW.gif",Ma="/c/assets/141.BToOkxf2.gif",Ua="/c/assets/142.C3wekjfY.png",Ra="/c/assets/143.CKuuzuQ_.png",Oa="/c/assets/144.B4r6Nv14.gif",Ia="/c/assets/145.CvbhuZNK.png",Na="/c/assets/146.BPgYm4ZX.gif",Va="/c/assets/147.DH2fri13.gif",Ga="/c/assets/148.CDDIqy03.gif",Xa="/c/assets/149.DCQsqYYC.gif",$a="/c/assets/150.CUjMoXNF.gif",Ha="/c/assets/151.BWbajkuB.gif",Ka="/c/assets/152.C1JnBDr7.png",Qa="/c/assets/153.DwN2p3bo.png",ja="/c/assets/154.DdSfz-Pf.gif",Ya="/c/assets/155.BMocjVt7.gif",Ja="/c/assets/156.BUU-wlaw.gif",Za="/c/assets/157.ssadIF0D.gif",za="/c/assets/158.Dq5lLq9v.gif",si="/c/assets/159.CJ0_loZ8.gif",ai="/c/assets/160.BPOK9irZ.gif",ii="/c/assets/161.B1eB55rC.gif",ni="/c/assets/162.VIcU-hkN.gif",li="/c/assets/163.BM9viRZJ.gif",ei="/c/assets/164.DpMBA1SK.gif",pi="/c/assets/165.DgXuU6LF.png",ti="/c/assets/166.Dnw73s2h.gif",ri="/c/assets/167.SnFXRSaL.png",ci="/c/assets/168.DnoEqOjV.png",hi="/c/assets/169.BJBdn7pw.png",di="/c/assets/170.DXtQWYsM.gif",oi="/c/assets/171.hcERTQkN.gif",ki="/c/assets/172.CioraEUv.png",ui="/c/assets/173.kWHWwnc_.png",Ai=JSON.parse('{"title":"第一章:开发环境的安装和配置(⭐)","description":"","frontmatter":{},"headers":[],"relativePath":"notes/01_c-basic/01_xdx/index.md","filePath":"notes/01_c-basic/01_xdx/index.md","lastUpdated":1723354837000}'),gi={name:"notes/01_c-basic/01_xdx/index.md"},bi=n('<h1 id="第一章-开发环境的安装和配置-⭐" tabindex="-1">第一章:开发环境的安装和配置(⭐) <a class="header-anchor" href="#第一章-开发环境的安装和配置-⭐" aria-label="Permalink to &quot;第一章:开发环境的安装和配置(⭐)&quot;"></a></h1><h2 id="_1-1-编译器的安装和配置" tabindex="-1">1.1 编译器的安装和配置 <a class="header-anchor" href="#_1-1-编译器的安装和配置" aria-label="Permalink to &quot;1.1 编译器的安装和配置&quot;"></a></h2><h3 id="_1-1-1-概述" tabindex="-1">1.1.1 概述 <a class="header-anchor" href="#_1-1-1-概述" aria-label="Permalink to &quot;1.1.1 概述&quot;"></a></h3><ul><li>要开发 C/C++ 程序,需要安装 C/C++ 编译器,目前有两种主流实现,即: <ul><li>GCCGNU Compiler Collection全平台实现即支持 Windows、MacOS、Linux 等。</li><li>MSVCMicrosoft Visual C++):只支持 Windows 系统。</li></ul></li><li>GCC 在 Windows 上的版本有很多,如:<a href="https://www.mingw-w64.org/" target="_blank" rel="noreferrer">MinGW-w64</a>、<a href="https://cygwin.com/" target="_blank" rel="noreferrer">Gygwin</a>、<a href="https://www.msys2.org/" target="_blank" rel="noreferrer">MSYS2</a>。它们之间的区别,如下所示:</li></ul><table tabindex="0"><thead><tr><th>特性</th><th>MinGW-w64</th><th>Cygwin</th><th>MSYS2</th></tr></thead><tbody><tr><td><strong>简介</strong></td><td>Minimalist GNU for Windows</td><td>POSIX 兼容环境和工具集</td><td>结合了 MinGW 和 Cygwin 的工具集</td></tr><tr><td><strong>编译器</strong></td><td>提供 GCC 编译器</td><td>提供 POSIX 兼容环境,包含大量工具</td><td>提供 MinGW-w64 工具链和 Cygwin 环境</td></tr><tr><td><strong>生成文件</strong></td><td>Windows 原生可执行文件</td><td>POSIX 兼容的可执行文件</td><td>可以生成 Windows 原生可执行文件或 POSIX 文件</td></tr><tr><td><strong>依赖</strong></td><td>无需额外依赖</td><td>依赖 Cygwin DLL</td><td>根据使用工具链决定MinGW-w64 无依赖Cygwin 有依赖)</td></tr><tr><td><strong>工具和库</strong></td><td>基本的编译工具</td><td>丰富的 Unix 工具和库</td><td>丰富的工具和库,强大的包管理系统</td></tr><tr><td><strong>性能</strong></td><td>性能较好</td><td>可能较低,因为通过兼容层调用系统</td><td>取决于使用的工具链MinGW-w64 性能较好)</td></tr><tr><td><strong>复杂度</strong></td><td>简单易用</td><td>设置和使用相对复杂</td><td>较为灵活,复杂度介于 MinGW-w64 和 Cygwin 之间</td></tr><tr><td><strong>适用场景</strong></td><td>开发 Windows 原生应用</td><td>运行和开发 Unix 程序</td><td>混合使用 Unix 工具和开发 Windows 原生应用</td></tr><tr><td><strong>优点</strong></td><td>轻量级,直接生成 Windows 应用</td><td>完整的 POSIX 兼容环境,丰富的工具</td><td>灵活的环境,强大的包管理系统</td></tr><tr><td><strong>缺点</strong></td><td>工具和库较少</td><td>生成文件依赖 Cygwin DLL性能可能较低</td><td>环境较大,占用更多空间,复杂性比 MinGW-w64 高</td></tr></tbody></table><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① MinGW-w64 、Cygwin 以及 MSYS2 任选其一安装即可。</li><li>② 目前的 Win10 和 Win11 版本支持 WSL2 Windows Sub Linux 2 ,即 Windows 的子系统 Linux可以实现在 Windows 系统上安装一个 Linux ,然后再运行 Linux 中的 GCC 工具链。</li><li>③ 本人的操作系统是 Win11 ,安装和配置都将以该系统为基础作为演示,后续不再赘述!!!</li></ul></div><h3 id="_1-1-2-mingw-w64-的安装和配置" tabindex="-1">1.1.2 MinGW-w64 的安装和配置 <a class="header-anchor" href="#_1-1-2-mingw-w64-的安装和配置" aria-label="Permalink to &quot;1.1.2 MinGW-w64 的安装和配置&quot;"></a></h3><h4 id="_1-1-2-1-安装" tabindex="-1">1.1.2.1 安装 <a class="header-anchor" href="#_1-1-2-1-安装" aria-label="Permalink to &quot;1.1.2.1 安装&quot;"></a></h4><ul><li>下载到本地:略。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>下载地址在<a href="https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-posix-seh-ucrt-rt_v11-rev1.7z" target="_blank" rel="noreferrer">这里</a>。</p></div><p><img src="'+l+'" alt=""></p><ul><li>解压到指定的目录,即:</li></ul><p><img src="'+e+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>本人的解压目录是:<code>D:\\develop\\mingw64</code> 。</p></div><h4 id="_1-1-2-2-配置-path-环境变量" tabindex="-1">1.1.2.2 配置 path 环境变量 <a class="header-anchor" href="#_1-1-2-2-配置-path-环境变量" aria-label="Permalink to &quot;1.1.2.2 配置 path 环境变量&quot;"></a></h4><ul><li>配置环境变量,以便任意目录都可以执行 gcc 命令,即:</li></ul><p><img src="'+p+'" alt=""></p><p><img src="'+t+'" alt=""></p><p><img src="'+r+'" alt=""></p><p><img src="'+c+'" alt=""></p><p><img src="'+h+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>因为,本人安装 MinGW-w64 的目录是 <code>D:\\develop\\mingw64</code>,所以配置 path 环境变量就需要 <code>D:\\develop\\mingw64\\bin</code>。</p></div><p><img src="'+d+'" alt=""></p><ul><li>测试是否安装成功:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --version</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+o+'" alt=""></p><h3 id="_1-1-3-cygwin-的安装和配置" tabindex="-1">1.1.3 Cygwin 的安装和配置 <a class="header-anchor" href="#_1-1-3-cygwin-的安装和配置" aria-label="Permalink to &quot;1.1.3 Cygwin 的安装和配置&quot;"></a></h3><h4 id="_1-1-3-1-安装" tabindex="-1">1.1.3.1 安装 <a class="header-anchor" href="#_1-1-3-1-安装" aria-label="Permalink to &quot;1.1.3.1 安装&quot;"></a></h4><ul><li>下载到本地:略。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>下载地址在<a href="https://www.cygwin.com/install.html" target="_blank" rel="noreferrer">这里</a>。</p></div><p><img src="'+k+'" alt=""></p><ul><li>点击安装:</li></ul><p><img src="'+u+'" alt=""></p><p><img src="'+g+'" alt=""></p><p><img src="'+b+'" alt=""></p><p><img src="'+m+'" alt=""></p><p><img src="'+E+'" alt=""></p><p><img src="'+C+'" alt=""></p><p><img src="'+F+'" alt=""></p><p><img src="'+y+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>默认是最小化安装,没有 GCC需要选择 gcc-core、gcc-g++、make、gdb、binutils 。</p></div><p><img src="'+_+'" alt=""></p><p><img src="'+v+'" alt=""></p><p><img src="'+B+'" alt=""></p><p><img src="'+f+'" alt=""></p><p><img src="'+A+'" alt=""></p><p><img src="'+D+'" alt=""></p><p><img src="'+x+'" alt=""></p><p><img src="'+q+'" alt=""></p><p><img src="'+w+'" alt=""></p><h4 id="_1-1-3-2-配置-path-环境变量" tabindex="-1">1.1.3.2 配置 path 环境变量 <a class="header-anchor" href="#_1-1-3-2-配置-path-环境变量" aria-label="Permalink to &quot;1.1.3.2 配置 path 环境变量&quot;"></a></h4><ul><li>和 <code>3.1.2.2 配置 path 环境变量</code> 步骤相同:略。</li></ul><h3 id="_1-1-4-msys2-推荐" tabindex="-1">1.1.4 MSYS2推荐 <a class="header-anchor" href="#_1-1-4-msys2-推荐" aria-label="Permalink to &quot;1.1.4 MSYS2推荐&quot;"></a></h3><h4 id="_1-1-4-1-安装" tabindex="-1">1.1.4.1 安装 <a class="header-anchor" href="#_1-1-4-1-安装" aria-label="Permalink to &quot;1.1.4.1 安装&quot;"></a></h4><ul><li>下载到本地:略。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>下载地址在<a href="https://www.msys2.org/" target="_blank" rel="noreferrer">这里</a>。</p></div><p><img src="'+S+'" alt=""></p><ul><li>点击安装:</li></ul><p><img src="'+L+'" alt=""></p><p><img src="'+P+'" alt=""></p><p><img src="'+T+'" alt=""></p><p><img src="'+W+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>可能很多人,会遇到安装到 <code>50%</code> 就一直卡死在那边,不用慌,关闭它,再次重新安装即可。</p></div><p><img src="'+M+'" alt=""></p><ul><li>出现命令终端:</li></ul><p><img src="'+U+`" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>如果没有出现命令终端,也不要慌,去 Win11 操作系统的<code>开始</code>菜单,那边找一下,就能找到。</p></div><ul><li>替换清华镜像源(可选):</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sed</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -i</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;s#https\\?://mirror.msys2.org/#https://mirrors.tuna.tsinghua.edu.cn/msys2/#g&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /etc/pacman.d/mirrorlist</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">*</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><p><img src="`+R+'" alt=""></p><ul><li> gcc </li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pacman</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -Syu</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --noconfirm</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # </span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pacman</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -Sy</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> base-devel</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --noconfirm</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # </span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pacman</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -Sy</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> mingw-w64-x86_64-toolchain</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --noconfirm</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # gcc </span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+O+'" alt=""></p><h4 id="_1-1-4-2--path-" tabindex="-1">1.1.4.2 path <a class="header-anchor" href="#_1-1-4-2--path-" aria-label="Permalink to &quot;1.1.4.2 path &quot;"></a></h4><ul><li> <code>3.1.2.2 path </code> </li></ul><h2 id="_1-2--ide-" tabindex="-1">1.2 IDE <a class="header-anchor" href="#_1-2--ide-" aria-label="Permalink to &quot;1.2 IDE&quot;"></a></h2><ul><li><p><code></code></p><ul><li>便</li><li></li><li></li><li></li><li>便</li></ul></li><li><p>Visual StudioCLion VS Code IDEIntegrated Development Environment</p></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li> IDE</li><li> IDE 使</li><li> VS Code IDE IDE Visual Studio CLion IDE</li><li> 使 IDE 使<code></code> <code>vi</code>使 IDE IDE IDE IDE </li></ul></div><h2 id="_1-3-ide-" tabindex="-1">1.3 IDE <a class="header-anchor" href="#_1-3-ide-" aria-label="Permalink to &quot;1.3 IDE &quot;"></a></h2><h3 id="_1-3-1-clion" tabindex="-1">1.3.1 CLion <a class="header-anchor" href="#_1-3-1-clion" aria-label="Permalink to &quot;1.3.1 CLion&quot;"></a></h3><h4 id="_1-3-1-1-" tabindex="-1">1.3.1.1 <a class="header-anchor" href="#_1-3-1-1-" aria-label="Permalink to &quot;1.3.1.1 &quot;"></a></h4><ul><li><a href="https://www.jetbrains.com/clion/" target="_blank" rel="noreferrer">CLion</a> JetBrains C/C++ IDECMake C/C++ </li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> CLion 2024.1.4 </p></div><h4 id="_1-3-1-2-" tabindex="-1">1.3.1.2 <a class="header-anchor" href="#_1-3-1-2-" aria-label="Permalink to &quot;1.3.1.2 &quot;"></a></h4><ul><li></li></ul><p><img src="'+I+'" alt=""></p><ul><li></li></ul><p><img src="'+N+'" alt=""></p><ul><li></li></ul><p><img src="'+V+'" alt=""></p><ul><li></li></ul><p><img src="'+G+'" alt=""></p><ul><li></li></ul><p><img src="'+X+'" alt=""></p><ul><li></li></ul><p><img src="'+$+'" alt=""></p><h4 id="_1-3-1-3-" tabindex="-1">1.3.1.3 <a class="header-anchor" href="#_1-3-1-3-" aria-label="Permalink to &quot;1.3.1.3 &quot;"></a></h4><ul><li> CLion </li></ul><p><img src="'+H+'" alt=""></p><ul><li></li></ul><p><img src="'+K+'" alt=""></p><p><img src="'+Q+'" alt=""></p><ul><li> UI </li></ul><p><img src="'+j+'" alt=""></p><p><img src="'+Y+'" alt=""></p><ul><li> UI </li></ul><p><img src="'+J+'" alt=""></p><ul><li><code></code></li></ul><p><img src="'+Z+'" alt=""></p><ul><li><code></code> UTF-8</li></ul><p><img src="'+z+'" alt=""></p><ul><li><code></code> UTF-8</li></ul><p><img src="'+ss+'" alt=""></p><ul><li><code></code></li></ul><p><img src="'+as+'" alt=""></p><ul><li><code></code></li></ul><p><img src="'+is+'" alt=""></p><ul><li> GCC </li></ul><p><img src="'+ns+'" alt=""></p><h3 id="_1-3-2-vs-code" tabindex="-1">1.3.2 VS Code <a class="header-anchor" href="#_1-3-2-vs-code" aria-label="Permalink to &quot;1.3.2 VS Code&quot;"></a></h3><h4 id="_1-3-2-1-" tabindex="-1">1.3.2.1 <a class="header-anchor" href="#_1-3-2-1-" aria-label="Permalink to &quot;1.3.2.1 &quot;"></a></h4><ul><li><a href="https://code.visualstudio.com/" target="_blank" rel="noreferrer">Visual Studio Code (VS Code)</a> WindowsMacOS Linux IntelliSenseGitVS Code Azure </li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>Visual Studio Code C/C++ </p></div><h4 id="_1-3-2-2-" tabindex="-1">1.3.2.2 <a class="header-anchor" href="#_1-3-2-2-" aria-label="Permalink to &quot;1.3.2.2 &quot;"></a></h4><ul><li></li></ul><p><img src="'+ls+'" alt=""></p><ul><li></li></ul><p><img src="'+es+'" alt=""></p><ul><li></li></ul><p><img src="'+ps+'" alt=""></p><ul><li></li></ul><p><img src="'+ts+'" alt=""></p><ul><li></li></ul><p><img src="'+rs+'" alt=""></p><ul><li></li></ul><p><img src="'+cs+'" alt=""></p><ul><li></li></ul><p><img src="'+hs+'" alt=""></p><ul><li></li></ul><p><img src="'+ds+'" alt=""></p><h4 id="_1-3-2-3-" tabindex="-1">1.3.2.3 <a class="header-anchor" href="#_1-3-2-3-" aria-label="Permalink to &quot;1.3.2.3 &quot;"></a></h4><ul><li><code></code></li></ul><p><img src="'+os+'" alt=""></p><p><img src="'+ks+'" alt=""></p><ul><li> <code>C/C++</code> </li></ul><p><img src="'+us+'" alt=""></p><p><img src="'+gs+'" alt=""></p><h3 id="_1-3-3-microsoft-visual-studio" tabindex="-1">1.3.3 Microsoft Visual Studio <a class="header-anchor" href="#_1-3-3-microsoft-visual-studio" aria-label="Permalink to &quot;1.3.3 Microsoft Visual Studio&quot;"></a></h3><h4 id="_1-3-3-1-" tabindex="-1">1.3.3.1 <a class="header-anchor" href="#_1-3-3-1-" aria-label="Permalink to &quot;1.3.3.1 &quot;"></a></h4><ul><li><a href="https://visualstudio.microsoft.com/" target="_blank" rel="noreferrer">Visual Studio</a> VSUMLIDE</li><li>Visual Studio C/C++C#F#VB Web</li><li>Visual Studio 2022 (使)( 1199 / 799 )( 5999 / 2569 ) SKU </li><li>Visual Studio IDE Visual Studio 2022</li></ul><h4 id="_1-3-3-2-" tabindex="-1">1.3.3.2 <a class="header-anchor" href="#_1-3-3-2-" aria-label="Permalink to &quot;1.3.3.2 &quot;"></a></h4><ul><li></li></ul><p><img src="'+bs+'" alt=""></p><ul><li></li></ul><p><img src="'+ms+'" alt=""></p><ul><li></li></ul><p><img src="'+Es+'" alt=""></p><ul><li>使 C++ </li></ul><p><img src="'+Cs+'" alt=""></p><ul><li></li></ul><p><img src="'+Fs+'" alt=""></p><ul><li></li></ul><p><img src="'+ys+'" alt=""></p><ul><li></li></ul><p><img src="'+_s+'" alt=""></p><ul><li><code> SDK</code></li></ul><p><img src="'+vs+'" alt=""></p><ul><li><code></code></li></ul><p><img src="'+Bs+'" alt=""></p><ul><li></li></ul><p><img src="'+fs+'" alt=""></p><ul><li></li></ul><p><img src="'+As+'" alt=""></p><ul><li></li></ul><p><img src="'+Ds+'" alt=""></p><h4 id="_1-3-3-3-" tabindex="-1">1.3.3.3 <a class="header-anchor" href="#_1-3-3-3-" aria-label="Permalink to &quot;1.3.3.3 &quot;"></a></h4><ul><li> VS </li></ul><p><img src="'+xs+'" alt=""></p><ul><li></li></ul><p><img src="'+qs+'" alt=""></p><ul><li></li></ul><p><img src="'+ws+'" alt=""></p><ul><li> VS </li></ul><p><img src="'+Ss+'" alt=""></p><ul><li></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li> Pro <code>TD244-P4NB7-YQ6XK-Y8MMM-YWV2J</code></li><li> Enterprise <code>VHF9H-NXBBB-638P6-6JHCY-88JWH</code></li></ul></div><p><img src="'+Ls+'" alt=""></p><p><img src="'+Ps+'" alt=""></p><h1 id="-c--helloworld-" tabindex="-1">C HelloWorld <a class="header-anchor" href="#-c--helloworld-" aria-label="Permalink to &quot;C HelloWorld&quot;"></a></h1><h2 id="_2-1-" tabindex="-1">2.1 <a class="header-anchor" href="#_2-1-" aria-label="Permalink to &quot;2.1 &quot;"></a></h2><ul><li> <code>HelloWorld.c</code> </li></ul><p><img src="'+Ts+`" alt=""></p><ul><li> <code></code></li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(){</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Hello World&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><p><img src="`+Ts+'" alt=""></p><ul><li> <code>gcc</code> </li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.exe</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+Ms+'" alt=""></p><ul><li> </li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./HelloWorld.exe</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+Us+'" alt=""></p><h2 id="_2-2-vs-code-" tabindex="-1">2.2 VS Code <a class="header-anchor" href="#_2-2-vs-code-" aria-label="Permalink to &quot;2.2 VS Code &quot;"></a></h2><ul><li> <code></code></li></ul><p><img src="'+Rs+'" alt=""></p><ul><li> <code>vscode</code> </li></ul><p><img src="'+Os+'" alt=""></p><ul><li> <code>vscode</code> <code>HelloWorld.c</code> </li></ul><p><img src="'+Ns+'" alt=""></p><ul><li> VSCode C/C++ </li></ul><p><img src="'+Is+'" alt=""></p><p><img src="'+Vs+`" alt=""></p><ul><li> </li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><p><img src="`+Ws+'" alt=""></p><ul><li> <code>gcc</code> </li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.exe</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+Ms+'" alt=""></p><ul><li> </li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./HelloWorld.exe</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+Us+'" alt=""></p><h2 id="_2-2-vs-code-" tabindex="-1">2.2 VS Code <a class="header-anchor" href="#_2-2-vs-code-" aria-label="Permalink to &quot;2.2 VS Code &quot;"></a></h2><ul><li> <code></code></li></ul><p><img src="'+Rs+'" alt=""></p><ul><li> <code>vscode</code> </li></ul><p><img src="'+Os+'" alt=""></p><ul><li> <code>vscode</code> <code>HelloWorld.c</code> </li></ul><p><img src="'+Is+'" alt=""></p><ul><li> VSCode C/C++ </li></ul><p><img src="'+Ns+'" alt=""></p><p><img src="'+Vs+`" alt=""></p><ul><li> </li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(){</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Hello World&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
@ -19,7 +21,7 @@ import{_ as s,c as a,o as i,a6 as n}from"./chunks/framework.CZRoMP2i.js";const l
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Hello World&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><p><img src="`+ea+'" alt=""></p><ul><li> </li></ul><p><img src="'+pa+'" alt=""></p><ul><li> c main CLion </li></ul><p><img src="'+ta+'" alt=""></p><ul><li> </li></ul><p><img src="'+ra+'" alt=""></p><p><img src="'+ca+`" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p></p><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>-Dfile.encoding=UTF-8</span></span>
<span class="line"><span>-Dconsole.encoding=UTF-8</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div></div><h1 id="--c--" tabindex="-1"> C <a class="header-anchor" href="#--c--" aria-label="Permalink to &quot; C &quot;"></a></h1><h2 id="_3-1-" tabindex="-1">3.1 <a class="header-anchor" href="#_3-1-" aria-label="Permalink to &quot;3.1 &quot;"></a></h2><ul><li> C C </li></ul><h2 id="_3-2-" tabindex="-1">3.2 <a class="header-anchor" href="#_3-2-" aria-label="Permalink to &quot;3.2 &quot;"></a></h2><ul><li> WindowsLinux MacOS </li><li> Windows 使 C/C++ <code>MSVC</code> Microsoft Visual C++ Visual Studio <ul><li> <strong></strong>: Windows Windows API PE </li><li> <strong></strong>: Visual Studio Debugger</li><li> <strong></strong>: Windows </li><li> <strong></strong>: Windows <s>MFCMicrosoft Foundation Class Library</s></li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>MSVC 使 Visual Studio Community 使 Visual Studio Community </p></div><ul><li> Linux 使 C/C++ <code>GCC</code> Linux GCC <ul><li> <strong>广</strong>: Linux </li><li> <strong></strong>: </li><li> <strong></strong>: GDBGNU MakeAutoconf </li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>GCC WindowsLinux MacOS Windows GCC MinGWCygwin MSYS2</p><ul><li> MinGW GCC Windows Windows </li><li> Cygwin Windows Unix POSIX GCC </li><li> MSYS2 Windows Unix-like Windows Linux MSYS2 MinGW Cygwin </li></ul></div><ul><li> MacOS 使 C/C++ <code>Clang/LLVM</code> <ul><li> <strong>Xcode </strong>: Xcode Apple macOSiOStvOSwatchOS</li><li> <strong></strong>: Apple GCC </li><li> <strong></strong>: Clang C </li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> MacOS Clang Homebrew GCC 便 C/C++ </p></div><h2 id="_3-3-" tabindex="-1">3.3 <a class="header-anchor" href="#_3-3-" aria-label="Permalink to &quot;3.3 &quot;"></a></h2><ul><li><p> C </p><ul><li><code>GCC (GNU Compiler Collection)</code> <ul><li>GCC 广使 ARMAVRMIPSRISC-V </li><li>广</li></ul></li><li><code>Clang/LLVM</code> <ul><li>Clang LLVM GCC </li><li></li></ul></li><li><code>SDCC (Small Device C Compiler)</code> <ul><li>: SDCC C 8 16 8051Z80PIC </li><li></li></ul></li><li><code>MPLAB XC Compilers</code> <ul><li>MPLAB XC Microchip PIC dsPIC </li><li>使</li></ul></li><li><code>ARM GCC</code> <ul><li>ARM GCC GCC ARM Cortex-M </li><li>广</li></ul></li><li><code>PlatformIO</code> <ul><li>PlatformIO </li><li></li></ul></li><li><code>Eclipse</code> <ul><li>Eclipse IDE</li><li>Eclipse GCC </li></ul></li><li><code>Arduino IDE</code> <ul><li>Arduino IDE 广 Arduino </li><li></li></ul></li><li>...</li></ul></li><li><p></p></li></ul><h2 id="_3-4-c-" tabindex="-1">3.4 C <a class="header-anchor" href="#_3-4-c-" aria-label="Permalink to &quot;3.4 C &quot;"></a></h2><ul><li>C C C 100% </li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p></p></div><ul><li> C C <ul><li>GCCLLVM/Clang C </li><li>MSVC VC6.0VS2010 使 C89 VS2015 C99 </li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> C++ C </p></div><ul><li> MSVC GCC GCC MSVC 使 MSVC GCC </li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>使 C 使 GCC C </p></div><h1 id="--" tabindex="-1"> <a class="header-anchor" href="#--" aria-label="Permalink to &quot;&quot;"></a></h1><h2 id="_4-1-" tabindex="-1">4.1 <a class="header-anchor" href="#_4-1-" aria-label="Permalink to &quot;4.1 &quot;"></a></h2><ul><li><code></code><code></code></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li> </li><li> <code></code><code></code></li></ul></div><h2 id="_4-2-" tabindex="-1">4.2 <a class="header-anchor" href="#_4-2-" aria-label="Permalink to &quot;4.2 &quot;"></a></h2><ul><li>C </li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// </span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> CLion <code>Ctrl + /</code> </p></div><ul><li></li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // </span></span>
<span class="line"><span>-Dconsole.encoding=UTF-8</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div></div><h1 id="--c--" tabindex="-1"> C <a class="header-anchor" href="#--c--" aria-label="Permalink to &quot; C &quot;"></a></h1><h2 id="_3-1-" tabindex="-1">3.1 <a class="header-anchor" href="#_3-1-" aria-label="Permalink to &quot;3.1 &quot;"></a></h2><ul><li> C C </li></ul><h2 id="_3-2-" tabindex="-1">3.2 <a class="header-anchor" href="#_3-2-" aria-label="Permalink to &quot;3.2 &quot;"></a></h2><ul><li> WindowsLinux MacOS </li><li> Windows 使 C/C++ <code>MSVC</code> Microsoft Visual C++ Visual Studio <ul><li> : Windows Windows API PE </li><li> : Visual Studio Debugger</li><li> : Windows </li><li> : Windows <s>MFCMicrosoft Foundation Class Library</s></li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>MSVC 使 Visual Studio Community 使 Visual Studio Community </p></div><ul><li> Linux 使 C/C++ <code>GCC</code> Linux GCC <ul><li> 广: Linux </li><li> : </li><li> : GDBGNU MakeAutoconf </li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>GCC WindowsLinux MacOS Windows GCC MinGWCygwin MSYS2</p><ul><li> MinGW GCC Windows Windows </li><li> Cygwin Windows Unix POSIX GCC </li><li> MSYS2 Windows Unix-like Windows Linux MSYS2 MinGW Cygwin </li></ul></div><ul><li> MacOS 使 C/C++ <code>Clang/LLVM</code> <ul><li> Xcode : Xcode Apple macOSiOStvOSwatchOS</li><li> : Apple GCC </li><li> : Clang C </li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> MacOS Clang Homebrew GCC 便 C/C++ </p></div><h2 id="_3-3-" tabindex="-1">3.3 <a class="header-anchor" href="#_3-3-" aria-label="Permalink to &quot;3.3 &quot;"></a></h2><ul><li><p> C </p><ul><li><code>GCC (GNU Compiler Collection)</code> <ul><li>GCC 广使 ARMAVRMIPSRISC-V </li><li>广</li></ul></li><li><code>Clang/LLVM</code> <ul><li>Clang LLVM GCC </li><li></li></ul></li><li><code>SDCC (Small Device C Compiler)</code> <ul><li>: SDCC C 8 16 8051Z80PIC </li><li></li></ul></li><li><code>MPLAB XC Compilers</code> <ul><li>MPLAB XC Microchip PIC dsPIC </li><li>使</li></ul></li><li><code>ARM GCC</code> <ul><li>ARM GCC GCC ARM Cortex-M </li><li>广</li></ul></li><li><code>PlatformIO</code> <ul><li>PlatformIO </li><li></li></ul></li><li><code>Eclipse</code> <ul><li>Eclipse IDE</li><li>Eclipse GCC </li></ul></li><li><code>Arduino IDE</code> <ul><li>Arduino IDE 广 Arduino </li><li></li></ul></li><li>...</li></ul></li><li><p></p></li></ul><h2 id="_3-4-c-" tabindex="-1">3.4 C <a class="header-anchor" href="#_3-4-c-" aria-label="Permalink to &quot;3.4 C &quot;"></a></h2><ul><li>C C C 100% </li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p></p></div><ul><li> C C <ul><li>GCCLLVM/Clang C </li><li>MSVC VC6.0VS2010 使 C89 VS2015 C99 </li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> C++ C </p></div><ul><li> MSVC GCC GCC MSVC 使 MSVC GCC </li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>使 C 使 GCC C </p></div><h1 id="--" tabindex="-1"> <a class="header-anchor" href="#--" aria-label="Permalink to &quot;&quot;"></a></h1><h2 id="_4-1-" tabindex="-1">4.1 <a class="header-anchor" href="#_4-1-" aria-label="Permalink to &quot;4.1 &quot;"></a></h2><ul><li><code></code><code></code></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li> </li><li> <code></code><code></code></li></ul></div><h2 id="_4-2-" tabindex="-1">4.2 <a class="header-anchor" href="#_4-2-" aria-label="Permalink to &quot;4.2 &quot;"></a></h2><ul><li>C </li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// </span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> CLion <code>Ctrl + /</code> </p></div><ul><li></li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // </span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // </span></span>
<span class="line"></span>
@ -76,7 +78,7 @@ import{_ as s,c as a,o as i,a6 as n}from"./chunks/framework.CZRoMP2i.js";const l
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 编译器将在系统的标准头文件目录中查找文件。</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;filename&gt;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 编译器首先在当前目录中查找文件,如果未找到,再在标准头文件目录中查找。</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;filename&quot;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><h1 id="-clion--" tabindex="-1">CLion <a class="header-anchor" href="#-clion--" aria-label="Permalink to &quot;CLion &quot;"></a></h1><h2 id="_6-1--wsl2" tabindex="-1">6.1 WSL2 <a class="header-anchor" href="#_6-1--wsl2" aria-label="Permalink to &quot;6.1 WSL2&quot;"></a></h2><h3 id="_6-1-1-" tabindex="-1">6.1.1 <a class="header-anchor" href="#_6-1-1-" aria-label="Permalink to &quot;6.1.1 &quot;"></a></h3><ul><li>WSL 2 Windows Subsystem for Linux 2 Windows Linux WSL 2 WSL Linux WSL 1 使广</li><li></li></ul><p><img src="`+ha+'" alt=""></p><ul><li><p>WSL2 </p><ul><li> <strong>Linux</strong>WSL 2 使 Linux WSL 2 Linux </li><li> <strong></strong>WSL 2 WSL 1 I/O WSL 2 </li><li> <strong></strong>使 Linux WSL 2 Linux WSL 1 WSL 2</li><li> <strong></strong>WSL 2 Windows </li><li> <strong>使</strong>WSL 2 使</li></ul></li><li><p>WSL </p><ul><li> <strong></strong>WSL 2 Linux Windows Linux </li><li> <strong></strong>使 WSL 2 Windows Linux </li><li> <strong></strong>WSL 2 Windows Linux </li><li> <strong> Linux </strong>WSL 2 Windows Linux Docker</li></ul></li></ul><h3 id="_6-1-2-wsl2-" tabindex="-1">6.1.2 WSL2 <a class="header-anchor" href="#_6-1-2-wsl2-" aria-label="Permalink to &quot;6.1.2 WSL2 &quot;"></a></h3><ul><li> BIOS UEFI </li></ul><p><img src="'+da+'" alt=""></p><ul><li> </li></ul><p><img src="'+oa+'" alt=""></p><ul><li> Linux Windows </li></ul><div class="language-powershell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">powershell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">dism.exe</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> /</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">online </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">enable-feature</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> /</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">featurename:Microsoft</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Windows</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Subsystem</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Linux </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">all </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">norestart</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p> PowerShell </p></div><p><img src="'+ka+'" alt=""></p><ul><li> </li></ul><div class="language-powershell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">powershell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">dism.exe</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> /</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">online </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">enable-feature</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> /</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">featurename:VirtualMachinePlatform </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">all </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">norestart</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p> PowerShell </p></div><p><img src="'+ua+'" alt=""></p><ul><li> Linux </li></ul><div class="language-powershell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">powershell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">wsl </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">--</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">update</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>wsl2 Linux GitHub Github <a href="https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi" target="_blank" rel="noreferrer"></a></p></div><p><img src="'+ga+'" alt=""></p><ul><li> wsl2 </li></ul><div class="language-powershell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">powershell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">wsl </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">--</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">set-default</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">version </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+ba+'" alt=""></p><ul><li> 线 Linux </li></ul><div class="language-powershell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">powershell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">wsl </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">--</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">list </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">--</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">online</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+ma+'" alt=""></p><ul><li> Linux </li></ul><div class="language-powershell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">powershell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">wsl </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">--</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">install Ubuntu</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">24.04</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> Linux Github Github <code>Microsoft Store</code> </p></div><p><img src="'+Ca+'" alt=""></p><ul><li> Microsoft Store </li></ul><p><img src="'+Ea+'" alt=""></p><ul><li> Linux </li></ul><div class="language-powershell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">powershell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">wsl </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">--</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">list</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+Fa+`" alt=""></p><h3 id="_6-1-3--wsl2" tabindex="-1">6.1.3 WSL2 <a class="header-anchor" href="#_6-1-3--wsl2" aria-label="Permalink to &quot;6.1.3 WSL2&quot;"></a></h3><ul><li> AlmaLinux9 便 cmake </li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dnf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> update</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # </span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;filename&quot;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><h1 id="-clion--" tabindex="-1">CLion <a class="header-anchor" href="#-clion--" aria-label="Permalink to &quot;CLion &quot;"></a></h1><h2 id="_6-1--wsl2" tabindex="-1">6.1 WSL2 <a class="header-anchor" href="#_6-1--wsl2" aria-label="Permalink to &quot;6.1 WSL2&quot;"></a></h2><h3 id="_6-1-1-" tabindex="-1">6.1.1 <a class="header-anchor" href="#_6-1-1-" aria-label="Permalink to &quot;6.1.1 &quot;"></a></h3><ul><li>WSL 2 Windows Subsystem for Linux 2 Windows Linux WSL 2 WSL Linux WSL 1 使广</li><li></li></ul><p><img src="`+ha+'" alt=""></p><ul><li><p>WSL2 </p><ul><li> <strong>Linux</strong>WSL 2 使 Linux WSL 2 Linux </li><li> <strong></strong>WSL 2 WSL 1 I/O WSL 2 </li><li> <strong></strong>使 Linux WSL 2 Linux WSL 1 WSL 2</li><li> <strong></strong>WSL 2 Windows </li><li> <strong>使</strong>WSL 2 使</li></ul></li><li><p>WSL </p><ul><li> <strong></strong>WSL 2 Linux Windows Linux </li><li> <strong></strong>使 WSL 2 Windows Linux </li><li> <strong></strong>WSL 2 Windows Linux </li><li> <strong> Linux </strong>WSL 2 Windows Linux Docker</li></ul></li></ul><h3 id="_6-1-2-wsl2-" tabindex="-1">6.1.2 WSL2 <a class="header-anchor" href="#_6-1-2-wsl2-" aria-label="Permalink to &quot;6.1.2 WSL2 &quot;"></a></h3><ul><li> BIOS UEFI </li></ul><p><img src="'+da+'" alt=""></p><ul><li> </li></ul><p><img src="'+oa+'" alt=""></p><ul><li> Linux Windows </li></ul><div class="language-powershell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">powershell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">dism.exe</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> /</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">online </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">enable-feature</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> /</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">featurename:Microsoft</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Windows</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Subsystem</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Linux </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">all </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">norestart</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p> PowerShell </p></div><p><img src="'+ka+'" alt=""></p><ul><li> </li></ul><div class="language-powershell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">powershell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">dism.exe</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> /</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">online </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">enable-feature</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> /</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">featurename:VirtualMachinePlatform </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">all </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">/</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">norestart</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p> PowerShell </p></div><p><img src="'+ua+'" alt=""></p><ul><li> Linux </li></ul><div class="language-powershell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">powershell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">wsl </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">--</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">update</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>wsl2 Linux GitHub Github <a href="https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi" target="_blank" rel="noreferrer"></a></p></div><p><img src="'+ga+'" alt=""></p><ul><li> wsl2 </li></ul><div class="language-powershell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">powershell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">wsl </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">--</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">set-default</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">version </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+ba+'" alt=""></p><ul><li> 线 Linux </li></ul><div class="language-powershell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">powershell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">wsl </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">--</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">list </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">--</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">online</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+ma+'" alt=""></p><ul><li> Linux </li></ul><div class="language-powershell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">powershell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">wsl </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">--</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">install Ubuntu</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">24.04</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> Linux Github Github <code>Microsoft Store</code> </p></div><p><img src="'+Ea+'" alt=""></p><ul><li> Microsoft Store </li></ul><p><img src="'+Ca+'" alt=""></p><ul><li> Linux </li></ul><div class="language-powershell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">powershell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">wsl </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">--</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">list</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+Fa+`" alt=""></p><h3 id="_6-1-3--wsl2" tabindex="-1">6.1.3 WSL2 <a class="header-anchor" href="#_6-1-3--wsl2" aria-label="Permalink to &quot;6.1.3 WSL2&quot;"></a></h3><ul><li> AlmaLinux9 便 cmake </li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dnf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> update</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # </span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dnf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> groupinstall</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Development Tools&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # </span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dnf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> gcc-c++</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # GCC</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dnf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> cmake</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # cmake</span></span>
@ -148,7 +150,7 @@ import{_ as s,c as a,o as i,a6 as n}from"./chunks/framework.CZRoMP2i.js";const l
<span class="line"><span> target_sources(\${EXECUTABLE_NAME} PRIVATE \${MODULE_SOURCES})</span></span>
<span class="line"><span> endif ()</span></span>
<span class="line"><span> endif ()</span></span>
<span class="line"><span>endforeach ()</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br></div></div><h2 id="_6-4--clang-format-" tabindex="-1">6.4 .clang-format <a class="header-anchor" href="#_6-4--clang-format-" aria-label="Permalink to &quot;6.4 .clang-format &quot;"></a></h2><ul><li> <code>.clang-format</code> 便 C </li></ul><p><img src="`+xa+`" alt=""></p><ul><li><code>.clang-format</code> </li></ul><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>BasedOnStyle: Google</span></span>
<span class="line"><span>endforeach ()</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br></div></div><h2 id="_6-4--clang-format-" tabindex="-1">6.4 .clang-format <a class="header-anchor" href="#_6-4--clang-format-" aria-label="Permalink to &quot;6.4 .clang-format &quot;"></a></h2><ul><li> <code>.clang-format</code> 便 C </li></ul><p><img src="`+Da+`" alt=""></p><ul><li><code>.clang-format</code> </li></ul><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>BasedOnStyle: Google</span></span>
<span class="line"><span>IndentWidth: 4</span></span>
<span class="line"><span>UseTab: Never</span></span>
<span class="line"><span>ColumnLimit: 0</span></span>
@ -180,10 +182,10 @@ import{_ as s,c as a,o as i,a6 as n}from"./chunks/framework.CZRoMP2i.js";const l
<span class="line"><span>SpacesInParentheses: false</span></span>
<span class="line"><span>SpacesInAngles: false</span></span>
<span class="line"><span>SpacesInContainerLiterals: false</span></span>
<span class="line"><span>SpacesInCStyleCastParentheses: false</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br></div></div><ul><li>CLion <code></code><code></code></li></ul><p><img src="`+Da+'" alt=""></p><h2 id="_6-5--gitignore-" tabindex="-1">6.5 .gitignore <a class="header-anchor" href="#_6-5--gitignore-" aria-label="Permalink to &quot;6.5 .gitignore &quot;"></a></h2><ul><li> <code>.gitignore</code> 便 Git </li></ul><p><img src="'+qa+`" alt=""></p><ul><li><code>.gitignore</code> </li></ul><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>.vscode</span></span>
<span class="line"><span>SpacesInCStyleCastParentheses: false</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br></div></div><ul><li>CLion <code></code><code></code></li></ul><p><img src="`+xa+'" alt=""></p><h2 id="_6-5--gitignore-" tabindex="-1">6.5 .gitignore <a class="header-anchor" href="#_6-5--gitignore-" aria-label="Permalink to &quot;6.5 .gitignore &quot;"></a></h2><ul><li> <code>.gitignore</code> 便 Git </li></ul><p><img src="'+qa+`" alt=""></p><ul><li><code>.gitignore</code> </li></ul><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>.vscode</span></span>
<span class="line"><span>.idea</span></span>
<span class="line"><span>cmake-build-*</span></span>
<span class="line"><span>build</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><h2 id="_6-6-" tabindex="-1">6.6 <a class="header-anchor" href="#_6-6-" aria-label="Permalink to &quot;6.6 &quot;"></a></h2><ul><li></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p><code> CMake </code></p></div><p><img src="`+wa+'" alt=""></p><h1 id="-c--" tabindex="-1">C <a class="header-anchor" href="#-c--" aria-label="Permalink to &quot;C &quot;"></a></h1><h2 id="_7-1-" tabindex="-1">7.1 <a class="header-anchor" href="#_7-1-" aria-label="Permalink to &quot;7.1 &quot;"></a></h2><ul><li>C </li></ul><p><img src="'+Sa+'" alt=""></p><ul><li> C </li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p> <code>.c</code> </p></div><ul><li> C <code></code> <code>.obj</code> <code>.o</code> C </li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li><p> <code></code><code></code><code></code><code></code></p></li><li><p> <code></code><code>#include</code><code>#define</code></p><ul><li><p><strong></strong><code>#include &lt;stdio.h&gt;</code><code>stdio.h</code></p></li><li><p><strong></strong><code>#define PI 3.14</code><code>PI</code><code>3.14</code></p></li><li><p><strong></strong><code>#ifdef</code><code>#ifndef</code></p></li><li><p><strong></strong></p></li><li><p><code>.i</code></p></li></ul></li><li><p> <code></code><code>.s</code></p></li><li><p> <code></code><code>.o</code> <code>.obj</code></p></li></ul></div><ul><li> <code>*.obj</code> <code>*.o</code><code></code> <code>*.exe</code></li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li></li><li> C 使 C <code>&lt;stdio.h&gt;</code> <code>printf()</code> C Linux crt0.ccrti.c main() </li></ul></div><ul><li> <code>*.exe</code> <code>*.exe</code> </li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p><code></code><code></code><code></code> <code>*.exe</code></p></div><h2 id="_7-2-gcc-" tabindex="-1">7.2 GCC <a class="header-anchor" href="#_7-2-gcc-" aria-label="Permalink to &quot;7.2 GCC &quot;"></a></h2><ul><li>vim vscode </li><li></li><li>gccGNU Compiler CollectionGNU GNU gcc GNU Unix LinuxBSDMac OS X gcc Windows </li><li>gcc C gcc CC++JavaAdafortranObject CObject C++Go </li></ul><h2 id="_7-3--gcc-" tabindex="-1">7.3 gcc <a class="header-anchor" href="#_7-3--gcc-" aria-label="Permalink to &quot;7.3 gcc &quot;"></a></h2><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.exe</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+La+'" alt=""></p><h2 id="_7-4--gcc-" tabindex="-1">7.4 gcc <a class="header-anchor" href="#_7-4--gcc-" aria-label="Permalink to &quot;7.4 gcc &quot;"></a></h2><h3 id="_7-3-1-" tabindex="-1">7.3.1 <a class="header-anchor" href="#_7-3-1-" aria-label="Permalink to &quot;7.3.1 &quot;"></a></h3><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -E</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .i</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # .i </span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -S</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .i</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .s</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Linux .s Windows .asm </span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -c</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .s</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .o</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Linux .o Windows .obj </span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .o</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .exe</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Linux .out Windows .exe </span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><h3 id="_7-4-2-" tabindex="-1">7.4.2 <a class="header-anchor" href="#_7-4-2-" aria-label="Permalink to &quot;7.4.2 &quot;"></a></h3><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -E</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.i</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+Pa+'" alt=""></p><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -S</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.i</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.s</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+Wa+'" alt=""></p><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -c</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.s</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.o</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+Ta+'" alt=""></p><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.o</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.exe</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+Ma+'" alt=""></p><h1 id="-" tabindex="-1"> <a class="header-anchor" href="#-" aria-label="Permalink to &quot;&quot;"></a></h1><h2 id="_8-1-wsl2-" tabindex="-1">8.1 WSL2 <a class="header-anchor" href="#_8-1-wsl2-" aria-label="Permalink to &quot;8.1 WSL2 &quot;"></a></h2><ul><li> WSL2 </li></ul><p><img src="'+Ua+`" alt=""></p><ul><li> <code>%USERPROFILE%\\.wslconfig</code></li></ul><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>[wsl2]</span></span>
<span class="line"><span>build</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><h2 id="_6-6-" tabindex="-1">6.6 <a class="header-anchor" href="#_6-6-" aria-label="Permalink to &quot;6.6 &quot;"></a></h2><ul><li></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p><code> CMake </code></p></div><p><img src="`+wa+'" alt=""></p><h1 id="-c--" tabindex="-1">C <a class="header-anchor" href="#-c--" aria-label="Permalink to &quot;C &quot;"></a></h1><h2 id="_7-1-" tabindex="-1">7.1 <a class="header-anchor" href="#_7-1-" aria-label="Permalink to &quot;7.1 &quot;"></a></h2><ul><li>C </li></ul><p><img src="'+Sa+'" alt=""></p><ul><li> C </li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p> <code>.c</code> </p></div><ul><li> C <code></code> <code>.obj</code> <code>.o</code> C </li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li><p> <code></code><code></code><code></code><code></code></p></li><li><p> <code></code><code>#include</code><code>#define</code></p><ul><li><p><code>#include &lt;stdio.h&gt;</code><code>stdio.h</code></p></li><li><p><code>#define PI 3.14</code><code>PI</code><code>3.14</code></p></li><li><p><code>#ifdef</code><code>#ifndef</code></p></li><li><p></p></li><li><p><code>.i</code></p></li></ul></li><li><p> <code></code><code>.s</code></p></li><li><p> <code></code><code>.o</code> <code>.obj</code></p></li></ul></div><ul><li> <code>*.obj</code> <code>*.o</code><code></code> <code>*.exe</code></li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li></li><li> C 使 C <code>&lt;stdio.h&gt;</code> <code>printf()</code> C Linux crt0.ccrti.c main() </li></ul></div><ul><li> <code>*.exe</code> <code>*.exe</code> </li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p><code></code><code></code><code></code> <code>*.exe</code></p></div><h2 id="_7-2-gcc-" tabindex="-1">7.2 GCC <a class="header-anchor" href="#_7-2-gcc-" aria-label="Permalink to &quot;7.2 GCC &quot;"></a></h2><ul><li>vim vscode </li><li></li><li>gccGNU Compiler CollectionGNU GNU gcc GNU Unix LinuxBSDMac OS X gcc Windows </li><li>gcc C gcc CC++JavaAdafortranObject CObject C++Go </li></ul><h2 id="_7-3--gcc-" tabindex="-1">7.3 gcc <a class="header-anchor" href="#_7-3--gcc-" aria-label="Permalink to &quot;7.3 gcc &quot;"></a></h2><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.exe</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+La+'" alt=""></p><h2 id="_7-4--gcc-" tabindex="-1">7.4 gcc <a class="header-anchor" href="#_7-4--gcc-" aria-label="Permalink to &quot;7.4 gcc &quot;"></a></h2><h3 id="_7-3-1-" tabindex="-1">7.3.1 <a class="header-anchor" href="#_7-3-1-" aria-label="Permalink to &quot;7.3.1 &quot;"></a></h3><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -E</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .i</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # .i </span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -S</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .i</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .s</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Linux .s Windows .asm </span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -c</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .s</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .o</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Linux .o Windows .obj </span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .o</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .exe</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Linux .out Windows .exe </span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><h3 id="_7-4-2-" tabindex="-1">7.4.2 <a class="header-anchor" href="#_7-4-2-" aria-label="Permalink to &quot;7.4.2 &quot;"></a></h3><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -E</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.i</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+Pa+'" alt=""></p><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -S</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.i</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.s</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+Ta+'" alt=""></p><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -c</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.s</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.o</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+Wa+'" alt=""></p><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.o</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.exe</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+Ma+'" alt=""></p><h1 id="-" tabindex="-1"> <a class="header-anchor" href="#-" aria-label="Permalink to &quot;&quot;"></a></h1><h2 id="_8-1-wsl2-" tabindex="-1">8.1 WSL2 <a class="header-anchor" href="#_8-1-wsl2-" aria-label="Permalink to &quot;8.1 WSL2 &quot;"></a></h2><ul><li> WSL2 </li></ul><p><img src="'+Ua+`" alt=""></p><ul><li> <code>%USERPROFILE%\\.wslconfig</code></li></ul><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>[wsl2]</span></span>
<span class="line"><span>networkingMode=mirrored</span></span>
<span class="line"><span>dnsTunneling=true</span></span>
<span class="line"><span>firewall=true</span></span>
@ -192,7 +194,7 @@ import{_ as s,c as a,o as i,a6 as n}from"./chunks/framework.CZRoMP2i.js";const l
<span class="line"><span>[experimental]</span></span>
<span class="line"><span># requires dnsTunneling but are also OPTIONAL</span></span>
<span class="line"><span>bestEffortDnsParsing=true</span></span>
<span class="line"><span>useWindowsDnsCache=true</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br></div></div><p><img src="`+Ra+'" alt=""></p><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">wsl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --shutdown</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+Oa+'" alt=""></p><ul><li></li></ul><p><img src="'+Na+'" alt=""></p><h2 id="_8-2-clion-" tabindex="-1">8.2 CLion <a class="header-anchor" href="#_8-2-clion-" aria-label="Permalink to &quot;8.2 CLion &quot;"></a></h2><ul><li> CLion run <code>printf</code> <code>scanf</code> </li></ul><p><img src="'+Ia+'" alt=""></p><ul><li> debug <code>printf</code> <code>scanf</code> </li></ul><p><img src="'+Va+`" alt=""></p><ul><li> <code>scanf</code> <code>scanf</code> <code></code></li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span></span>
<span class="line"><span>useWindowsDnsCache=true</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br></div></div><p><img src="`+Ra+'" alt=""></p><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">wsl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --shutdown</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+Oa+'" alt=""></p><ul><li></li></ul><p><img src="'+Ia+'" alt=""></p><h2 id="_8-2-clion-" tabindex="-1">8.2 CLion <a class="header-anchor" href="#_8-2-clion-" aria-label="Permalink to &quot;8.2 CLion &quot;"></a></h2><ul><li> CLion run <code>printf</code> <code>scanf</code> </li></ul><p><img src="'+Na+'" alt=""></p><ul><li> debug <code>printf</code> <code>scanf</code> </li></ul><p><img src="'+Va+`" alt=""></p><ul><li> <code>scanf</code> <code>scanf</code> <code></code></li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 禁用 stdout 缓冲区</span></span>
@ -280,4 +282,4 @@ import{_ as s,c as a,o as i,a6 as n}from"./chunks/framework.CZRoMP2i.js";const l
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libelf++0</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libbfb0-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> python-dev-is-python3</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><p><img src="`+ai+`" alt=""></p><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clone</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --depth</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --single-branch</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --branch=linux-msft-wsl-\${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">KERNEL_VERSION</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://github.com/microsoft/WSL2-Linux-Kernel.git</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><p><img src="`+ii+'" alt=""></p><ul><li>编译内核代码:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> WSL2-Linux-Kernel</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">make</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -j</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">nproc</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">KCONFIG_CONFIG=Microsoft/config-wsl</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+ni+'" alt=""></p><ul><li>编译 perf 工具:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> tools/perf</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">make</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clean</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">make</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+li+'" alt=""></p><ul><li>复制到 PATH 变量所指向的路径中:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">cp</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> perf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /usr/bin/</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+ei+'" alt=""></p><h3 id="_8-4-3-整合" tabindex="-1">8.4.3 整合 <a class="header-anchor" href="#_8-4-3-整合" aria-label="Permalink to &quot;8.4.3 整合&quot;"></a></h3><ul><li>CLion 中配置 perf 的路径:</li></ul><p><img src="'+pi+'" alt=""></p><ul><li>在 CLion 中通过 perf 运行代码:</li></ul><p><img src="'+ti+'" alt=""></p><h2 id="_8-5-win-中文乱码问题" tabindex="-1">8.5 Win 中文乱码问题 <a class="header-anchor" href="#_8-5-win-中文乱码问题" aria-label="Permalink to &quot;8.5 Win 中文乱码问题&quot;"></a></h2><ul><li>前文,我们提及到,在 Win 中,如果出现<code>中文乱码</code>问题,就需要去<code>语言和区别</code>设置<code>系统区域</code>的编码为 UTF-8 但是这样可能会造成其它的软件出现中文乱码问题Xshell 等。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 之所以,修改系统的编码为 UTF-8 会出现问题,是因为早期的 Win 系统的中文默认编码是 GBK目前也是Win 并没有强制第三方软件使用 UTF-8 编码) ,而 Xshell 等也使用的这些编码,一旦我们修改为 UTF-8 之后,可能会造成这些第三方软件出现中文乱码问题(第三方软件适配问题,相信将来应该都会切换为 UTF-8 编码),体验较差!!!</li><li>② 在 Linux 或 MacOS 之所以不会出现中文乱码的问题,是因为这些系统默认的编码就是 UTF-8 。</li></ul></div><ul><li>其实,还有一种解决方案,如下所示:</li></ul><p><img src="'+ri+'" alt=""></p><p><img src="'+ci+'" alt=""></p><p><img src="'+hi+'" alt=""></p><ul><li>测试一下,是否配置成功:</li></ul><p><img src="'+di+'" alt=""></p><h2 id="_8-6-clion-中自动导入头文件" tabindex="-1">8.6 CLion 中自动导入头文件 <a class="header-anchor" href="#_8-6-clion-中自动导入头文件" aria-label="Permalink to &quot;8.6 CLion 中自动导入头文件&quot;"></a></h2><ul><li>在 CLion 中,最为强大的功能就是直接输入函数,然后让 IDE 帮我们自动导入头文件,包括自定义的头文件,相当实用。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① CLion 中的<code>自动导入头文件</code>的<code>快捷键</code>是 <code>Alt + Enter</code> 。</li><li>② CLion 中的<code>自动提取变量的类型</code>的<code>快捷键</code>是 <code>Ctrl + Alt + V</code> 。</li></ul></div><p><img src="'+oi+'" alt=""></p><ul><li>开启自动导入头文件的步骤,如下所示:</li></ul><p><img src="'+ki+'" alt=""></p><p><img src="'+ui+'" alt=""></p>',548),mi=[bi];function Ci(Ei,Fi,yi,_i,vi,Bi){return i(),a("div",null,mi)}const xi=s(gi,[["render",Ci]]);export{Ai as __pageData,xi as default};
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://github.com/microsoft/WSL2-Linux-Kernel.git</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><p><img src="`+ii+'" alt=""></p><ul><li>编译内核代码:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> WSL2-Linux-Kernel</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">make</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -j</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">nproc</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">KCONFIG_CONFIG=Microsoft/config-wsl</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+ni+'" alt=""></p><ul><li>编译 perf 工具:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> tools/perf</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">make</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clean</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">make</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+li+'" alt=""></p><ul><li>复制到 PATH 变量所指向的路径中:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">cp</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> perf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /usr/bin/</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+ei+'" alt=""></p><h3 id="_8-4-3-整合" tabindex="-1">8.4.3 整合 <a class="header-anchor" href="#_8-4-3-整合" aria-label="Permalink to &quot;8.4.3 整合&quot;"></a></h3><ul><li>CLion 中配置 perf 的路径:</li></ul><p><img src="'+pi+'" alt=""></p><ul><li>在 CLion 中通过 perf 运行代码:</li></ul><p><img src="'+ti+'" alt=""></p><h2 id="_8-5-win-中文乱码问题" tabindex="-1">8.5 Win 中文乱码问题 <a class="header-anchor" href="#_8-5-win-中文乱码问题" aria-label="Permalink to &quot;8.5 Win 中文乱码问题&quot;"></a></h2><ul><li>前文,我们提及到,在 Win 中,如果出现<code>中文乱码</code>问题,就需要去<code>语言和区别</code>设置<code>系统区域</code>的编码为 UTF-8 但是这样可能会造成其它的软件出现中文乱码问题Xshell 等。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 之所以,修改系统的编码为 UTF-8 会出现问题,是因为早期的 Win 系统的中文默认编码是 GBK目前也是Win 并没有强制第三方软件使用 UTF-8 编码) ,而 Xshell 等也使用的这些编码,一旦我们修改为 UTF-8 之后,可能会造成这些第三方软件出现中文乱码问题(第三方软件适配问题,相信将来应该都会切换为 UTF-8 编码),体验较差!!!</li><li>② 在 Linux 或 MacOS 之所以不会出现中文乱码的问题,是因为这些系统默认的编码就是 UTF-8 。</li></ul></div><ul><li>其实,还有一种解决方案,如下所示:</li></ul><p><img src="'+ri+'" alt=""></p><p><img src="'+ci+'" alt=""></p><p><img src="'+hi+'" alt=""></p><ul><li>测试一下,是否配置成功:</li></ul><p><img src="'+di+'" alt=""></p><h2 id="_8-6-clion-中自动导入头文件" tabindex="-1">8.6 CLion 中自动导入头文件 <a class="header-anchor" href="#_8-6-clion-中自动导入头文件" aria-label="Permalink to &quot;8.6 CLion 中自动导入头文件&quot;"></a></h2><ul><li>在 CLion 中,最为强大的功能就是直接输入函数,然后让 IDE 帮我们自动导入头文件,包括自定义的头文件,相当实用。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① CLion 中的<code>自动导入头文件</code>的<code>快捷键</code>是 <code>Alt + Enter</code> 。</li><li>② CLion 中的<code>自动提取变量的类型</code>的<code>快捷键</code>是 <code>Ctrl + Alt + V</code> 。</li></ul></div><p><img src="'+oi+'" alt=""></p><ul><li>开启自动导入头文件的步骤,如下所示:</li></ul><p><img src="'+ki+'" alt=""></p><p><img src="'+ui+'" alt=""></p>',554),mi=[bi];function Ei(Ci,Fi,yi,_i,vi,Bi){return i(),a("div",null,mi)}const Di=s(gi,[["render",Ei]]);export{Ai as __pageData,Di as default};

View File

@ -1 +1 @@
import{_ as s,c as a,o as i,a6 as n}from"./chunks/framework.CZRoMP2i.js";const l="/c/assets/1.D60Zf6_d.png",e="/c/assets/2.D2-G6nV2.png",p="/c/assets/3.DpzkVk5V.png",t="/c/assets/4.BXk95GIP.png",r="/c/assets/5.CbWTB08W.png",c="/c/assets/6.twO9TCIg.png",h="/c/assets/7.CKOjeIvS.png",d="/c/assets/8.DKmR0CxE.png",o="/c/assets/9.Cudf77_s.gif",k="/c/assets/10.BBUUlhRC.png",u="/c/assets/11.iLABkB7O.png",g="/c/assets/12.BQuYWOU9.png",b="/c/assets/13.CslpH6j0.png",m="/c/assets/14.BAyvZdKq.png",C="/c/assets/15.C3oC1iUd.png",E="/c/assets/16.Ds-jsEZn.png",F="/c/assets/17.Cd37gMYs.png",y="/c/assets/18.CAw2z3gc.png",_="/c/assets/19.DdPThnr-.png",v="/c/assets/20.q_rvlDnY.png",B="/c/assets/21.JRHg9RZA.png",f="/c/assets/22.Baq-Hb06.png",A="/c/assets/23.c1ht53mu.png",x="/c/assets/24.CAZmH5Py.png",D="/c/assets/25.DWeCYBe9.png",q="/c/assets/26.2XM8pYni.png",w="/c/assets/27.CN0t-fuo.png",S="/c/assets/28.AcDh3LXQ.png",L="/c/assets/29.CUkDFAc6.png",P="/c/assets/30.picNTNaJ.png",W="/c/assets/31.DKX92RgJ.png",T="/c/assets/32.Bxr7QKI3.png",M="/c/assets/33.DuFWsOgW.png",U="/c/assets/34.Da9qUcfr.png",R="/c/assets/35.7_gEABSX.gif",O="/c/assets/36.C2KQYoVC.gif",N="/c/assets/37.RTUP8Vtx.png",I="/c/assets/38.Dq21DxwL.png",V="/c/assets/39.QmpUaNxU.png",G="/c/assets/40.DP0C29gZ.png",X="/c/assets/41.DwzHokd4.png",$="/c/assets/42.Bi6K26yA.png",H="/c/assets/43.Bw8DcEQ_.png",K="/c/assets/44.DPc8Z9rS.png",Q="/c/assets/45.S84xHMTl.png",j="/c/assets/46.iw3JQUkn.png",Y="/c/assets/47.ILeJt-HK.png",J="/c/assets/48.CHgm7khh.png",Z="/c/assets/49.N1nqJaEg.png",z="/c/assets/50.DHsnibMi.png",ss="/c/assets/51.BQr6Q0uV.png",as="/c/assets/52.BVemi2Lh.png",is="/c/assets/53.BHR69UXx.png",ns="/c/assets/54.CPSU5SJI.png",ls="/c/assets/55.CaQLoDlw.png",es="/c/assets/56.aRGy4XbL.png",ps="/c/assets/57.kNO9fmPR.png",ts="/c/assets/58.D4EkoC4o.png",rs="/c/assets/59.V23Lo9e_.png",cs="/c/assets/60.Du9LVeMB.png",hs="/c/assets/61.DdFg75U9.png",ds="/c/assets/62.C6bz6KtT.png",os="/c/assets/63.CB6LAhB5.png",ks="/c/assets/64.Bip8bkua.png",us="/c/assets/65.DRNHRduW.png",gs="/c/assets/66.Cth4qqEn.png",bs="/c/assets/67.DWGWZ64P.png",ms="/c/assets/68.3hDIDdvx.png",Cs="/c/assets/69.Bw_dQ4ap.png",Es="/c/assets/70.Cn_ubTyA.png",Fs="/c/assets/71.C84EBqwB.png",ys="/c/assets/72.dZfJY4eR.png",_s="/c/assets/73.B0zm0Z79.png",vs="/c/assets/74.CaTcEy1Q.png",Bs="/c/assets/75.iEc8mo9g.png",fs="/c/assets/76.Co2KxM6t.png",As="/c/assets/77.CaUm8Qhc.png",xs="/c/assets/78.kOkqIKG6.png",Ds="/c/assets/79.CyeASH-c.png",qs="/c/assets/80.CFdk60La.png",ws="/c/assets/81.Bhl-0uK_.png",Ss="/c/assets/82.Dni9KbXV.png",Ls="/c/assets/83.BXx10MCV.png",Ps="/c/assets/84.CXcIKX1T.png",Ws="/c/assets/85.CQ3_QCQT.png",Ts="/c/assets/86.CQoDRJM5.gif",Ms="/c/assets/87.CPfwZvD9.gif",Us="/c/assets/88.bxEomEjU.gif",Rs="/c/assets/89.C_onhf2k.png",Os="/c/assets/90.Budj3s38.gif",Ns="/c/assets/91.CH8koQdu.gif",Is="/c/assets/92.kUJhxMtg.png",Vs="/c/assets/93.BJeJJW4_.png",Gs="/c/assets/94.BCuK6eJL.gif",Xs="/c/assets/95.rKC-z4z-.gif",$s="/c/assets/96.BJE3xxuT.gif",Hs="/c/assets/97.DJOq__O0.gif",Ks="/c/assets/98.BDt_0fRR.png",Qs="/c/assets/99.Bo5OawW8.png",js="/c/assets/100.sUWUfl5e.png",Ys="/c/assets/101.BK4jpnB8.png",Js="/c/assets/102.EF8vdbSq.png",Zs="/c/assets/103.DjxdA_Co.png",zs="/c/assets/104.sp68q1hh.gif",sa="/c/assets/105.DhMRyxNN.gif",aa="/c/assets/106.CdcLZM0R.gif",ia="/c/assets/107.D-5AsTTr.png",na="/c/assets/108.2RQKmAUa.png",la="/c/assets/109.CI4xX8SM.png",ea="/c/assets/110.C8QUZ9v3.gif",pa="/c/assets/111.g5tQfhWz.gif",ta="/c/assets/112.CX0_1NsE.gif",ra="/c/assets/113.BrFJeoK6.png",ca="/c/assets/114.58TjSSjH.gif",ha="/c/assets/115.CgqNV2hL.png",da="/c/assets/116.BasYWvkM.png",oa="/c/assets/117.CjFxJpBr.png",ka="/c/assets/118.Dm5Jspvp.gif",ua="/c/assets/119.1krCh8cy.gif",ga="/c/assets/120.DOSyahv7.gif",ba="/c/assets/121.BHEvX_FI.gif",ma="/c/assets/122.DFA0g1_d.gif",Ca="/c/assets/123.D50nO5eA.gif",Ea="/c/assets/124.cAvG1Qfq.png",Fa="/c/assets/125.DpakQFWz.gif",ya="/c/assets/126.Bg61j9QI.gif",_a="/c/assets/127.DPvD9UCw.gif",va="/c/assets/128.Ceu65U_n.gif",Ba="/c/assets/129.BWPFRK_8.gif",fa="/c/assets/130.Ct4TfxPf.gif",Aa="/c/assets/131.zsKtx_jV.png",xa="/c/assets/132.3oqDAW0w.png",Da="/c/assets/133.D9TSeAa9.gif",qa="/c/assets/134.CCRgYIVq.png",wa="/c/assets/135.C1t2T6FV.gif",Sa="/c/assets/136.Rqa4uHq6.png",La="/c/assets/137.6yQYnjOa.gif",Pa="/c/assets/138.hYR9GiiD.gif",Wa="/c/assets/139.D3b-QIrA.gif",Ta="/c/assets/140.DGbA6qsW.gif",Ma="/c/assets/141.BToOkxf2.gif",Ua="/c/assets/142.C3wekjfY.png",Ra="/c/assets/143.CKuuzuQ_.png",Oa="/c/assets/144.B4r6Nv14.gif",Na="/c/assets/145.CvbhuZNK.png",Ia="/c/assets/146.BPgYm4ZX.gif",Va="/c/assets/147.DH2fri13.gif",Ga="/c/assets/148.CDDIqy03.gif",Xa="/c/assets/149.DCQsqYYC.gif",$a="/c/assets/150.CUjMoXNF.gif",Ha="/c/assets/151.BWbajkuB.gif",Ka="/c/assets/152.C1JnBDr7.png",Qa="/c/assets/153.DwN2p3bo.png",ja="/c/assets/154.DdSfz-Pf.gif",Ya="/c/assets/155.BMocjVt7.gif",Ja="/c/assets/156.BUU-wlaw.gif",Za="/c/assets/157.ssadIF0D.gif",za="/c/assets/158.Dq5lLq9v.gif",si="/c/assets/159.CJ0_loZ8.gif",ai="/c/assets/160.BPOK9irZ.gif",ii="/c/assets/161.B1eB55rC.gif",ni="/c/assets/162.VIcU-hkN.gif",li="/c/assets/163.BM9viRZJ.gif",ei="/c/assets/164.DpMBA1SK.gif",pi="/c/assets/165.DgXuU6LF.png",ti="/c/assets/166.Dnw73s2h.gif",ri="/c/assets/167.SnFXRSaL.png",ci="/c/assets/168.DnoEqOjV.png",hi="/c/assets/169.BJBdn7pw.png",di="/c/assets/170.DXtQWYsM.gif",oi="/c/assets/171.hcERTQkN.gif",ki="/c/assets/172.CioraEUv.png",ui="/c/assets/173.kWHWwnc_.png",Ai=JSON.parse('{"title":"第一章:开发环境的安装和配置(⭐)","description":"","frontmatter":{},"headers":[],"relativePath":"notes/01_c-basic/01_xdx/index.md","filePath":"notes/01_c-basic/01_xdx/index.md","lastUpdated":1723194975000}'),gi={name:"notes/01_c-basic/01_xdx/index.md"},bi=n("",548),mi=[bi];function Ci(Ei,Fi,yi,_i,vi,Bi){return i(),a("div",null,mi)}const xi=s(gi,[["render",Ci]]);export{Ai as __pageData,xi as default};
import{_ as s,c as a,o as i,a6 as n}from"./chunks/framework.CZRoMP2i.js";const l="/c/assets/1.D60Zf6_d.png",e="/c/assets/2.D2-G6nV2.png",p="/c/assets/3.DpzkVk5V.png",t="/c/assets/4.BXk95GIP.png",r="/c/assets/5.CbWTB08W.png",c="/c/assets/6.twO9TCIg.png",h="/c/assets/7.CKOjeIvS.png",d="/c/assets/8.DKmR0CxE.png",o="/c/assets/9.Cudf77_s.gif",k="/c/assets/10.BBUUlhRC.png",u="/c/assets/11.iLABkB7O.png",g="/c/assets/12.BQuYWOU9.png",b="/c/assets/13.CslpH6j0.png",m="/c/assets/14.BAyvZdKq.png",E="/c/assets/15.C3oC1iUd.png",C="/c/assets/16.Ds-jsEZn.png",F="/c/assets/17.Cd37gMYs.png",y="/c/assets/18.CAw2z3gc.png",_="/c/assets/19.DdPThnr-.png",v="/c/assets/20.q_rvlDnY.png",B="/c/assets/21.JRHg9RZA.png",f="/c/assets/22.Baq-Hb06.png",A="/c/assets/23.c1ht53mu.png",D="/c/assets/24.CAZmH5Py.png",x="/c/assets/25.DWeCYBe9.png",q="/c/assets/26.2XM8pYni.png",w="/c/assets/27.CN0t-fuo.png",S="/c/assets/28.AcDh3LXQ.png",L="/c/assets/29.CUkDFAc6.png",P="/c/assets/30.picNTNaJ.png",T="/c/assets/31.DKX92RgJ.png",W="/c/assets/32.Bxr7QKI3.png",M="/c/assets/33.DuFWsOgW.png",U="/c/assets/34.Da9qUcfr.png",R="/c/assets/35.7_gEABSX.gif",O="/c/assets/36.C2KQYoVC.gif",I="/c/assets/37.RTUP8Vtx.png",N="/c/assets/38.Dq21DxwL.png",V="/c/assets/39.QmpUaNxU.png",G="/c/assets/40.DP0C29gZ.png",X="/c/assets/41.DwzHokd4.png",$="/c/assets/42.Bi6K26yA.png",H="/c/assets/43.Bw8DcEQ_.png",K="/c/assets/44.DPc8Z9rS.png",Q="/c/assets/45.S84xHMTl.png",j="/c/assets/46.iw3JQUkn.png",Y="/c/assets/47.ILeJt-HK.png",J="/c/assets/48.CHgm7khh.png",Z="/c/assets/49.N1nqJaEg.png",z="/c/assets/50.DHsnibMi.png",ss="/c/assets/51.BQr6Q0uV.png",as="/c/assets/52.BVemi2Lh.png",is="/c/assets/53.BHR69UXx.png",ns="/c/assets/54.CPSU5SJI.png",ls="/c/assets/55.CaQLoDlw.png",es="/c/assets/56.aRGy4XbL.png",ps="/c/assets/57.kNO9fmPR.png",ts="/c/assets/58.D4EkoC4o.png",rs="/c/assets/59.V23Lo9e_.png",cs="/c/assets/60.Du9LVeMB.png",hs="/c/assets/61.DdFg75U9.png",ds="/c/assets/62.C6bz6KtT.png",os="/c/assets/63.CB6LAhB5.png",ks="/c/assets/64.Bip8bkua.png",us="/c/assets/65.DRNHRduW.png",gs="/c/assets/66.Cth4qqEn.png",bs="/c/assets/67.DWGWZ64P.png",ms="/c/assets/68.3hDIDdvx.png",Es="/c/assets/69.Bw_dQ4ap.png",Cs="/c/assets/70.Cn_ubTyA.png",Fs="/c/assets/71.C84EBqwB.png",ys="/c/assets/72.dZfJY4eR.png",_s="/c/assets/73.B0zm0Z79.png",vs="/c/assets/74.CaTcEy1Q.png",Bs="/c/assets/75.iEc8mo9g.png",fs="/c/assets/76.Co2KxM6t.png",As="/c/assets/77.CaUm8Qhc.png",Ds="/c/assets/78.kOkqIKG6.png",xs="/c/assets/79.CyeASH-c.png",qs="/c/assets/80.CFdk60La.png",ws="/c/assets/81.Bhl-0uK_.png",Ss="/c/assets/82.Dni9KbXV.png",Ls="/c/assets/83.BXx10MCV.png",Ps="/c/assets/84.CXcIKX1T.png",Ts="/c/assets/85.CQ3_QCQT.png",Ws="/c/assets/86.CQoDRJM5.gif",Ms="/c/assets/87.CPfwZvD9.gif",Us="/c/assets/88.bxEomEjU.gif",Rs="/c/assets/89.C_onhf2k.png",Os="/c/assets/90.Budj3s38.gif",Is="/c/assets/91.CH8koQdu.gif",Ns="/c/assets/92.kUJhxMtg.png",Vs="/c/assets/93.BJeJJW4_.png",Gs="/c/assets/94.BCuK6eJL.gif",Xs="/c/assets/95.rKC-z4z-.gif",$s="/c/assets/96.BJE3xxuT.gif",Hs="/c/assets/97.DJOq__O0.gif",Ks="/c/assets/98.BDt_0fRR.png",Qs="/c/assets/99.Bo5OawW8.png",js="/c/assets/100.sUWUfl5e.png",Ys="/c/assets/101.BK4jpnB8.png",Js="/c/assets/102.EF8vdbSq.png",Zs="/c/assets/103.DjxdA_Co.png",zs="/c/assets/104.sp68q1hh.gif",sa="/c/assets/105.DhMRyxNN.gif",aa="/c/assets/106.CdcLZM0R.gif",ia="/c/assets/107.D-5AsTTr.png",na="/c/assets/108.2RQKmAUa.png",la="/c/assets/109.CI4xX8SM.png",ea="/c/assets/110.C8QUZ9v3.gif",pa="/c/assets/111.g5tQfhWz.gif",ta="/c/assets/112.CX0_1NsE.gif",ra="/c/assets/113.BrFJeoK6.png",ca="/c/assets/114.58TjSSjH.gif",ha="/c/assets/115.CgqNV2hL.png",da="/c/assets/116.BasYWvkM.png",oa="/c/assets/117.CjFxJpBr.png",ka="/c/assets/118.Dm5Jspvp.gif",ua="/c/assets/119.1krCh8cy.gif",ga="/c/assets/120.DOSyahv7.gif",ba="/c/assets/121.BHEvX_FI.gif",ma="/c/assets/122.DFA0g1_d.gif",Ea="/c/assets/123.D50nO5eA.gif",Ca="/c/assets/124.cAvG1Qfq.png",Fa="/c/assets/125.DpakQFWz.gif",ya="/c/assets/126.Bg61j9QI.gif",_a="/c/assets/127.DPvD9UCw.gif",va="/c/assets/128.Ceu65U_n.gif",Ba="/c/assets/129.BWPFRK_8.gif",fa="/c/assets/130.Ct4TfxPf.gif",Aa="/c/assets/131.zsKtx_jV.png",Da="/c/assets/132.3oqDAW0w.png",xa="/c/assets/133.D9TSeAa9.gif",qa="/c/assets/134.CCRgYIVq.png",wa="/c/assets/135.C1t2T6FV.gif",Sa="/c/assets/136.Rqa4uHq6.png",La="/c/assets/137.6yQYnjOa.gif",Pa="/c/assets/138.hYR9GiiD.gif",Ta="/c/assets/139.D3b-QIrA.gif",Wa="/c/assets/140.DGbA6qsW.gif",Ma="/c/assets/141.BToOkxf2.gif",Ua="/c/assets/142.C3wekjfY.png",Ra="/c/assets/143.CKuuzuQ_.png",Oa="/c/assets/144.B4r6Nv14.gif",Ia="/c/assets/145.CvbhuZNK.png",Na="/c/assets/146.BPgYm4ZX.gif",Va="/c/assets/147.DH2fri13.gif",Ga="/c/assets/148.CDDIqy03.gif",Xa="/c/assets/149.DCQsqYYC.gif",$a="/c/assets/150.CUjMoXNF.gif",Ha="/c/assets/151.BWbajkuB.gif",Ka="/c/assets/152.C1JnBDr7.png",Qa="/c/assets/153.DwN2p3bo.png",ja="/c/assets/154.DdSfz-Pf.gif",Ya="/c/assets/155.BMocjVt7.gif",Ja="/c/assets/156.BUU-wlaw.gif",Za="/c/assets/157.ssadIF0D.gif",za="/c/assets/158.Dq5lLq9v.gif",si="/c/assets/159.CJ0_loZ8.gif",ai="/c/assets/160.BPOK9irZ.gif",ii="/c/assets/161.B1eB55rC.gif",ni="/c/assets/162.VIcU-hkN.gif",li="/c/assets/163.BM9viRZJ.gif",ei="/c/assets/164.DpMBA1SK.gif",pi="/c/assets/165.DgXuU6LF.png",ti="/c/assets/166.Dnw73s2h.gif",ri="/c/assets/167.SnFXRSaL.png",ci="/c/assets/168.DnoEqOjV.png",hi="/c/assets/169.BJBdn7pw.png",di="/c/assets/170.DXtQWYsM.gif",oi="/c/assets/171.hcERTQkN.gif",ki="/c/assets/172.CioraEUv.png",ui="/c/assets/173.kWHWwnc_.png",Ai=JSON.parse('{"title":"第一章:开发环境的安装和配置(⭐)","description":"","frontmatter":{},"headers":[],"relativePath":"notes/01_c-basic/01_xdx/index.md","filePath":"notes/01_c-basic/01_xdx/index.md","lastUpdated":1723354837000}'),gi={name:"notes/01_c-basic/01_xdx/index.md"},bi=n("",554),mi=[bi];function Ei(Ci,Fi,yi,_i,vi,Bi){return i(),a("div",null,mi)}const Di=s(gi,[["render",Ei]]);export{Ai as __pageData,Di as default};

View File

@ -1 +1 @@
{"index.md":"n0W-Fd-u","notes_01_c-basic_00_xdx_index.md":"DrhS56yE","notes_01_c-basic_01_xdx_index.md":"DynzO91I","notes_01_c-basic_02_xdx_index.md":"BaRUI6ln","notes_01_c-basic_03_xdx_index.md":"lC6l29W7","notes_01_c-basic_04_xdx_index.md":"DkXfRsso","notes_01_c-basic_05_xdx_index.md":"Dzk0jyse","notes_01_c-basic_06_xdx_index.md":"B8Z5KXti","notes_04_linux_01_xdx_index.md":"D7-UlHSH","notes_index.md":"bgNns6d1"}
{"index.md":"n0W-Fd-u","notes_01_c-basic_00_xdx_index.md":"DrhS56yE","notes_01_c-basic_01_xdx_index.md":"DEs09TjE","notes_01_c-basic_02_xdx_index.md":"BaRUI6ln","notes_01_c-basic_03_xdx_index.md":"lC6l29W7","notes_01_c-basic_04_xdx_index.md":"DkXfRsso","notes_01_c-basic_05_xdx_index.md":"Dzk0jyse","notes_01_c-basic_06_xdx_index.md":"B8Z5KXti","notes_04_linux_01_xdx_index.md":"D7-UlHSH","notes_index.md":"bgNns6d1"}

View File

@ -8,9 +8,9 @@
<meta name="generator" content="VitePress v1.3.2">
<link rel="preload stylesheet" href="/c/assets/style.8enJ9bsK.css" as="style">
<script type="module" src="/c/assets/app.DS7FIVmo.js"></script>
<script type="module" src="/c/assets/app.DOv65PSF.js"></script>
<link rel="preload" href="/c/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
<link rel="modulepreload" href="/c/assets/chunks/theme.BqwVBBaA.js">
<link rel="modulepreload" href="/c/assets/chunks/theme.CfoaGUmH.js">
<link rel="modulepreload" href="/c/assets/chunks/framework.CZRoMP2i.js">
<link rel="modulepreload" href="/c/assets/index.md.n0W-Fd-u.lean.js">
<link rel="shortcut icon" href="/c//logo.svg">
@ -21,7 +21,7 @@
</head>
<body>
<div id="app"><div class="Layout" data-v-5d98c3a5><!--[--><!--]--><!--[--><span tabindex="-1" data-v-0f60ec36></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-0f60ec36> Skip to content </a><!--]--><!----><header class="VPNav" data-v-5d98c3a5 data-v-ae24b3ad><div class="VPNavBar home top" data-v-ae24b3ad data-v-6aa21345><div class="wrapper" data-v-6aa21345><div class="container" data-v-6aa21345><div class="title" data-v-6aa21345><div class="VPNavBarTitle" data-v-6aa21345 data-v-ab179fa1><a class="title" href="/c/" data-v-ab179fa1><!--[--><!--]--><!--[--><img class="VPImage logo" src="/c/logo.svg" alt data-v-8426fc1a><!--]--><span data-v-ab179fa1>许大仙</span><!--[--><!--]--></a></div></div><div class="content" data-v-6aa21345><div class="content-body" data-v-6aa21345><!--[--><!--]--><div class="VPNavBarSearch search" data-v-6aa21345><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><span class="vp-icon DocSearch-Search-Icon"></span><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-6aa21345 data-v-dc692963><span id="main-nav-aria-label" class="visually-hidden" data-v-dc692963> Main Navigation </span><!--[--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/" target="_blank" rel="noreferrer" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>首页</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/coa6/notes/" target="_blank" rel="noreferrer" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>计组6件套</span><!--]--></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-dc692963 data-v-b6c34ac9><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-b6c34ac9><span class="text" data-v-b6c34ac9><!----><span data-v-b6c34ac9>编程语言</span><span class="vpi-chevron-down text-icon" data-v-b6c34ac9></span></span></button><div class="menu" data-v-b6c34ac9><div class="VPMenu" data-v-b6c34ac9 data-v-b98bc113><div class="items" data-v-b98bc113><!--[--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link" href="/c/notes/" data-v-43f1e123><!--[-->c/c++<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/web-design/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->前端<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/java/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->Java<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/big-data/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->大数据<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/linux/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->云原生<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/go/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->Go<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/python/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->Python<!--]--></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/open-software/notes/" target="_blank" rel="noreferrer" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>开源软件</span><!--]--></a><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-6aa21345 data-v-6c893767><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-6c893767 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-6aa21345 data-v-0394ad82 data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/Aurorxa" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-eee4e7cb><span class="vpi-social-github" /></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-6aa21345 data-v-bb2aa2f0 data-v-b6c34ac9><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-b6c34ac9><span class="vpi-more-horizontal icon" data-v-b6c34ac9></span></button><div class="menu" data-v-b6c34ac9><div class="VPMenu" data-v-b6c34ac9 data-v-b98bc113><!----><!--[--><!--[--><!----><div class="group" data-v-bb2aa2f0><div class="item appearance" data-v-bb2aa2f0><p class="label" data-v-bb2aa2f0>Appearance</p><div class="appearance-action" data-v-bb2aa2f0><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-bb2aa2f0 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div></div></div><div class="group" data-v-bb2aa2f0><div class="item social-links" data-v-bb2aa2f0><div class="VPSocialLinks social-links-list" data-v-bb2aa2f0 data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/Aurorxa" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-eee4e7cb><span class="vpi-social-github" /></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-6aa21345 data-v-e5dd9c1c><span class="container" data-v-e5dd9c1c><span class="top" data-v-e5dd9c1c></span><span class="middle" data-v-e5dd9c1c></span><span class="bottom" data-v-e5dd9c1c></span></span></button></div></div></div></div><div class="divider" data-v-6aa21345><div class="divider-line" data-v-6aa21345></div></div></div><!----></header><!----><!----><div class="VPContent is-home" id="VPContent" data-v-5d98c3a5 data-v-1428d186><div class="VPHome" data-v-1428d186 data-v-686f80a6><!--[--><!--]--><div class="VPHero VPHomeHero" data-v-686f80a6 data-v-303bb580><div class="container" data-v-303bb580><div class="main" data-v-303bb580><!--[--><!--]--><!--[--><h1 class="name" data-v-303bb580><span class="clip" data-v-303bb580>许大仙同学</span></h1><!----><p class="tagline" data-v-303bb580>『这个世纪疯狂,没人性,腐败;你却一直清醒,温柔,一尘不染。』</p><!--]--><!--[--><!--]--><div class="actions" data-v-303bb580><!--[--><div class="action" data-v-303bb580><a class="VPButton medium brand" href="https://aexiar.github.io" target="_blank" rel="noreferrer" data-v-303bb580 data-v-cad61b99>首页</a></div><div class="action" data-v-303bb580><a class="VPButton medium alt" href="https://aexiar.github.io/coa6/notes/" target="_blank" rel="noreferrer" data-v-303bb580 data-v-cad61b99>计组6件套</a></div><div class="action" data-v-303bb580><a class="VPButton medium alt" href="/c/notes/" data-v-303bb580 data-v-cad61b99>c/c++</a></div><div class="action" data-v-303bb580><a class="VPButton medium alt" href="https://aexiar.github.io/web-design/notes/" target="_blank" rel="noreferrer" data-v-303bb580 data-v-cad61b99>前端</a></div><div class="action" data-v-303bb580><a class="VPButton medium alt" href="https://aexiar.github.io/java/notes/" target="_blank" rel="noreferrer" data-v-303bb580 data-v-cad61b99>Java</a></div><div class="action" data-v-303bb580><a class="VPButton medium alt" href="https://aexiar.github.io/big-data/notes/" target="_blank" rel="noreferrer" data-v-303bb580 data-v-cad61b99>大数据</a></div><div class="action" data-v-303bb580><a class="VPButton medium alt" href="https://aexiar.github.io/linux/notes/" target="_blank" rel="noreferrer" data-v-303bb580 data-v-cad61b99>云原生</a></div><div class="action" data-v-303bb580><a class="VPButton medium alt" href="https://aexiar.github.io/go/notes/" target="_blank" rel="noreferrer" data-v-303bb580 data-v-cad61b99>Go</a></div><div class="action" data-v-303bb580><a class="VPButton medium alt" href="https://aexiar.github.io/python/notes/" target="_blank" rel="noreferrer" data-v-303bb580 data-v-cad61b99>Python</a></div><div class="action" data-v-303bb580><a class="VPButton medium alt" href="https://aexiar.github.io/open-software/notes/" target="_blank" rel="noreferrer" data-v-303bb580 data-v-cad61b99>开源软件</a></div><!--]--></div><!--[--><!--]--></div><!----></div></div><!--[--><!--]--><!--[--><!--]--><div class="VPFeatures VPHomeFeatures" data-v-686f80a6 data-v-a6181336><div class="container" data-v-a6181336><div class="items" data-v-a6181336><!--[--><div class="grid-3 item" data-v-a6181336><div class="VPLink no-icon VPFeature" data-v-a6181336 data-v-a3976bdc><!--[--><article class="box" data-v-a3976bdc><!----><h2 class="title" data-v-a3976bdc>学习思路</h2><p class="details" data-v-a3976bdc>学习思路就这么几条:模仿、遍历、分治、动态规划、……</p><!----></article><!--]--></div></div><div class="grid-3 item" data-v-a6181336><div class="VPLink no-icon VPFeature" data-v-a6181336 data-v-a3976bdc><!--[--><article class="box" data-v-a3976bdc><!----><h2 class="title" data-v-a3976bdc>学习手法</h2><p class="details" data-v-a3976bdc>学习手法就这么几种:缓存、索引、信号/事件、回调/消息循环/dispatcher、……</p><!----></article><!--]--></div></div><div class="grid-3 item" data-v-a6181336><div class="VPLink no-icon VPFeature" data-v-a6181336 data-v-a3976bdc><!--[--><article class="box" data-v-a3976bdc><!----><h2 class="title" data-v-a3976bdc>注意事项</h2><p class="details" data-v-a3976bdc>注意事项就这么几点:边界值、等价类、数据完整性原子性、死锁、空转、……</p><!----></article><!--]--></div></div><!--]--></div></div></div><!--[--><!--]--><div class="vp-doc container" style="" data-v-686f80a6 data-v-8e2d4988><!--[--><div style="position:relative;" data-v-686f80a6><div></div></div><!--]--></div></div></div><footer class="VPFooter" data-v-5d98c3a5 data-v-e315a0ad><div class="container" data-v-e315a0ad><p class="message" data-v-e315a0ad>Released under the MIT License.</p><p class="copyright" data-v-e315a0ad>Copyright © 2024 许大仙</p></div></footer><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DynzO91I\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DEs09TjE\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
</body>
</html>

View File

@ -8,9 +8,9 @@
<meta name="generator" content="VitePress v1.3.2">
<link rel="preload stylesheet" href="/c/assets/style.8enJ9bsK.css" as="style">
<script type="module" src="/c/assets/app.DS7FIVmo.js"></script>
<script type="module" src="/c/assets/app.DOv65PSF.js"></script>
<link rel="preload" href="/c/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
<link rel="modulepreload" href="/c/assets/chunks/theme.BqwVBBaA.js">
<link rel="modulepreload" href="/c/assets/chunks/theme.CfoaGUmH.js">
<link rel="modulepreload" href="/c/assets/chunks/framework.CZRoMP2i.js">
<link rel="modulepreload" href="/c/assets/notes_01_c-basic_00_xdx_index.md.DrhS56yE.lean.js">
<link rel="shortcut icon" href="/c//logo.svg">
@ -67,7 +67,7 @@
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br></div></div><ul><li>编程语言就是用于控制计算机,让其完成我们需要的功能。而我们学习编程语言,其实就是学习这些文字和符号编写的规则。</li><li>因为 CPU 只能识别二进制的指令,而我们<code>编写</code>的程序叫做<code>源代码</code>,是人类能看懂;但是,计算机却不能识别。那么,我们就需要让计算机能识别我们编写的源程序,就需要将我们编写的源代码交给编译器程序,其会帮助我们将所编写的源代码转换为计算机能够识别的二进制指令。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>编译器就是运行在操作系统之上的程序,其作用就是用来将程序员编写的源代码转换为计算机能够识别的二进制指令。</p></div><ul><li>如果我们用 Java 语言编写了程序(源代码),那么编写的程序也是不能直接运行的,需要通过 Java 语言的编译器将 Java 程序编译为计算机能够识别的二进制指令。</li><li>如果我们用 Python 语言编写了程序(源代码),那么编写的程序也是不能直接运行的,需要通过 Python 语言的编译器将 Python 程序编译为计算机能够识别的二进制指令。</li><li>……</li><li>总而言之,无论我们学习任何一门编程语言,想要将程序运行起来,都必须做如下的两件事情: <ul><li>① 学习该语言的文字和符号编写的规则,即:<code>语法规则</code></li><li>② 需要在操作系统上安装对应编程语言的<code>编译器</code>程序,将源程序编译为计算机能够识别的二进制指令。</li></ul></li></ul><h2 id="_2-3-计算机语言简史" tabindex="-1">2.3 计算机语言简史 <a class="header-anchor" href="#_2-3-计算机语言简史" aria-label="Permalink to &quot;2.3 计算机语言简史&quot;"></a></h2><h3 id="_2-3-1-机器语言-相当于人类的石器时代" tabindex="-1">2.3.1 机器语言(相当于人类的石器时代) <a class="header-anchor" href="#_2-3-1-机器语言-相当于人类的石器时代" aria-label="Permalink to &quot;2.3.1 机器语言(相当于人类的石器时代)&quot;"></a></h3><ul><li>1946 年 2 月 14 日,世界上第一台计算机 <code>ENIAC</code> 诞生,使用的是最原始的<code>穿透卡片</code></li></ul><p><img src="/c/assets/16.C2sciGZn.png" alt=""></p><ul><li>这种卡片使用的是用<code>二进制代码</code>表示的语言,和人类语言差别极大,这种语言就称为<code>机器语言</code>,如:</li></ul><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>0000,0000,000000010000 代表 LOAD A, 16</span></span>
<span class="line"><span>0000,0001,000000000001 代表 LOAD B, 1</span></span>
<span class="line"><span>0001,0001,000000010000 代表 STORE B, 16</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><ul><li>这种语言本质上是计算机能识别的<code>唯一语言</code>,人类很难理解;换言之,当时的程序员 99.9% 都是异类!!!</li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li>① 不同类型CPU 架构x86_64、arm 等的处理器有不同的机器语言指令集指令集架构ISA决定了机器语言的具体形式。</li><li>② 换言之,机器语言与特定硬件架构紧密相关,机器语言程序几乎没有可移植性。</li></ul></div><h3 id="_2-3-2-汇编语言-相当于人类的青铜-铁器时代" tabindex="-1">2.3.2 汇编语言(相当于人类的青铜&amp;铁器时代) <a class="header-anchor" href="#_2-3-2-汇编语言-相当于人类的青铜-铁器时代" aria-label="Permalink to &quot;2.3.2 汇编语言(相当于人类的青铜&amp;铁器时代)&quot;"></a></h3><ul><li><code>汇编语言</code>使用<code>助记符</code>MOV、ADD、SUB代替二进制操作码使程序更易于人类编写和理解因此<code>汇编语言</code>也被称为<code>符号语言</code></li></ul><p><img src="/c/assets/17.DdyXXyxJ.png" alt=""></p><ul><li>汇编语言的<code>优点</code>是能编写<code>高效率</code>的程序;但是,<code>缺点</code>和机器语言没什么不同,汇编语言同样<code>依赖于具体的计算机架构(面向机器)</code>,程序不具备跨平台的可移植性。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 汇编语言,目前仍然应用于工业电子编程领域、软件的加密解密、计算机病毒分析等。</li><li>② 汇编语言是编程语言的拓荒年代,它非常底层,直接和计算机硬件打交道,开发效率低,学习成本高。</li></ul></div><h3 id="_2-3-3-高级语言-相当于人类的信息时代" tabindex="-1">2.3.3 高级语言(相当于人类的信息时代) <a class="header-anchor" href="#_2-3-3-高级语言-相当于人类的信息时代" aria-label="Permalink to &quot;2.3.3 高级语言(相当于人类的信息时代)&quot;"></a></h3><ul><li><code>高级语言</code>是一种<code>接近于人们使用习惯</code>的程序设计语言。<code>它允许程序员使用接近日常英语的指令来编写程序</code>,程序中的符号和算式也和<code>日常使用的数学公式</code>差不多,接近于自然语言和数学语言,容易被人们掌握。</li></ul><p><img src="/c/assets/18.DIeb_KXW.png" alt=""></p><ul><li>高级语言<code>独立于计算机硬件</code>,有一定的通用性;计算机不能直接识别和执行用高级语言编写的程序,需要使用<code>编译器</code><code>解释器</code>转换为机器语言,才能被计算机识别和执行。</li></ul><p><img src="/c/assets/19.C-kvMz2p.png" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 普遍使用的高级编程语言C、C++、Java、Python、C#、JavaScript、Go、SQL 等。</li><li>② C 语言是“<a href="https://zh.wikipedia.org/wiki/%E8%BF%87%E7%A8%8B%E5%BC%8F%E7%BC%96%E7%A8%8B" target="_blank" rel="noreferrer">面向过程</a>”的编程语言,已经脱离了计算机硬件,就可以设计和开发<code>中等</code>规模的程序。</li><li>③ Java、C++、Python、C# 等都是“<a href="https://zh.wikipedia.org/wiki/%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E7%A8%8B%E5%BA%8F%E8%AE%BE%E8%AE%A1" target="_blank" rel="noreferrer">面向对象</a>”的编程语言(它们在“<a href="https://zh.wikipedia.org/wiki/%E8%BF%87%E7%A8%8B%E5%BC%8F%E7%BC%96%E7%A8%8B" target="_blank" rel="noreferrer">面向过程</a>”的基础上又增加了很多概念),就可以设计和开发<code>中大型</code>规模的程序。</li></ul><p>总结C 语言出现的时候,已经度过了编程语言的拓荒年代,具备了现代编程语言的特性,但是这个时候还没有出现“<a href="https://zh.wikipedia.org/wiki/%E8%BD%AF%E4%BB%B6%E5%8D%B1%E6%9C%BA" target="_blank" rel="noreferrer">软件危机</a>”,人们没有动力去开发更加高级的语言,所以也没有太复杂的编程思想;而之后出现的“<a href="https://zh.wikipedia.org/wiki/%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E7%A8%8B%E5%BA%8F%E8%AE%BE%E8%AE%A1" target="_blank" rel="noreferrer">面向对象</a>”的编程思想解决了一部分在“<a href="https://zh.wikipedia.org/wiki/%E8%BD%AF%E4%BB%B6%E5%8D%B1%E6%9C%BA" target="_blank" rel="noreferrer">软件危机</a>”上的窘境。</p></div><h3 id="_2-3-4-总结" tabindex="-1">2.3.4 总结 <a class="header-anchor" href="#_2-3-4-总结" aria-label="Permalink to &quot;2.3.4 总结&quot;"></a></h3><ul><li>编写语言的对比,如下所示:</li></ul><table tabindex="0"><thead><tr><th style="text-align:left;">类别</th><th style="text-align:left;">特征</th><th style="text-align:left;">优点</th><th style="text-align:left;">缺点</th><th style="text-align:left;">示例</th></tr></thead><tbody><tr><td style="text-align:left;"><strong>机器语言</strong></td><td style="text-align:left;">直接由计算机执行的二进制代码</td><td style="text-align:left;">执行速度快</td><td style="text-align:left;">编写困难,可读性差,与具体硬件强绑定</td><td style="text-align:left;">二进制代码</td></tr><tr><td style="text-align:left;"><strong>汇编语言</strong></td><td style="text-align:left;">用助记符代替二进制代码的低级语言</td><td style="text-align:left;">相对机器语言更易编写和理解,允许直接控制硬件资源</td><td style="text-align:left;">依然需要了解硬件,不够抽象,与具体硬件或平台相关</td><td style="text-align:left;">MOVADD 等助记符</td></tr><tr><td style="text-align:left;"><strong>高级语言</strong></td><td style="text-align:left;">接近人类语言,提供了更高层次的抽象</td><td style="text-align:left;">易于编写和维护,可移植性好,支持多种编程范式</td><td style="text-align:left;">需要通过编译器或解释器转换为机器语言,可能存在一定的性能损失</td><td style="text-align:left;">CJava Python 等</td></tr></tbody></table><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 这三种编程语言类型从低级到高级提供了不同层次的抽象,以满足不同的编程需求和场景。</li><li>② 随着计算机科学的发展,高级语言因其强大的表达能力、良好的可移植性和易用性,成为了日常软件开发的主流选择。</li></ul></div><h1 id="第三章-初识-c-语言" tabindex="-1">第三章:初识 C 语言 <a class="header-anchor" href="#第三章-初识-c-语言" aria-label="Permalink to &quot;第三章:初识 C 语言&quot;"></a></h1><h2 id="_3-1-c-语言的由来" tabindex="-1">3.1 C 语言的由来 <a class="header-anchor" href="#_3-1-c-语言的由来" aria-label="Permalink to &quot;3.1 C 语言的由来&quot;"></a></h2><ul><li>1969 年,美国贝尔实验室的<code>肯·汤姆森</code>Ken Thompson<code>丹尼斯·里奇</code>Dennis Ritchie一起开发了 Unix 操作系统。Unix 最初是使用<code>汇编语言</code>编写的,依赖于计算机硬件。为了程序的<code>可读性</code><code>可移植性</code>,它们决定使用高级语言重写。但是。当时的高级语言无法满足他们的要求,<code>肯·汤姆森</code>就在 BCPL 语言的基础上发明了 <code>B</code> 语言。</li><li>1972 年,<code>丹尼斯·里奇</code>Dennis Ritchie<code>B</code> 语言的基础上重新设计了一种新的语言,这种新语言取代了 <code>B</code> 语言,即 <code>C</code> 语言。</li></ul><p><img src="/c/assets/20.CQqFxmDa.png" alt=""></p><ul><li>1973 年,<code>整个 Unix 系统都使用 C 语言重写</code></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>C 语言最初是作为 Unix 系统的开发工具而发明的。</p></div><ul><li>此后这种语言快速流传广泛用于各种操作系统和系统软件的开发Unix、MS-DOS、Microsoft Windows 以及 Linux 等。</li></ul><p><img src="/c/assets/21.CjMWyIiX.png" alt=""></p><ul><li>1988 年美国国家标准协会ANSI正式将 <code>C 语言标准化</code>,标志着 C 语言开始稳定和规范化。</li></ul><h2 id="_3-2-为什么要学习-c-语言" tabindex="-1">3.2 为什么要学习 C 语言? <a class="header-anchor" href="#_3-2-为什么要学习-c-语言" aria-label="Permalink to &quot;3.2 为什么要学习 C 语言?&quot;"></a></h2><ul><li><code>C 语言具有可移植好、跨平台的特点</code>:用 C 语言编写的代码可以在不同的操作系统和硬件平台上编译和运行。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① C 语言的最原始的设计目的,就是为了将 Unix 操作系统移植到其他的计算机架构上,这使得它从一开始就非常注重可移植性。</li><li>② 这边所说的 C 语言的可移植性,是和汇编语言相比的;如果 C 语言和现代化的高级编程语言相比可移植性还是很差的Java 的口号是“一次编译到处运行”Go 的口号是“一次编译,到处执行”。</li></ul></div><ul><li><code>C 语言在许多领域应用广泛</code><ul><li><code>操作系统</code>C 广泛用于开发操作系统Unix、Linux 和 Windows。</li><li><code>嵌入式系统</code>C 是一种用于开发嵌入式系统(如:微控制器、微处理器和其它电子设备)的流程语言。</li><li><code>系统软件</code>C 用于开发设备驱动程序、编译器和汇编器等系统软件。</li><li><code>网络</code>C 语言广泛用于开发网络应用程序例如Web 服务器、网络协议和网络驱动程序。</li><li><code>数据库系统</code>C 用于开发数据库系统例如Oracle、MySQL 和 PostgreSQL 。</li><li><code>游戏</code>:由于 C 能够处理低级硬件交互,因此经常用于开发计算机游戏。</li><li><code>人工智能</code>C 用于开发人工智能和机器学习的应用程序,例如:神经网络和深度学习算法。</li><li><code>科学应用</code>C 用于开发科学应用程序,例如:仿真软件和数值分析工具。</li><li><code>金融应用</code>C 用于开发股票市场分析和交易系统等金融应用。</li></ul></li><li>③ C 语言能够直接对硬件进行操作、管理内存以及和操作系统对话,这使得它是一种非常接近底层的语言,非常适合<code>写需要和硬件交互、有极高性能要求</code>的程序。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>C 语言毕竟诞生的时间非常早20 世纪 70 年代),属于 70 后了,有点落后于现在的时代,虽然执行效率高,但是开发效率低。</li><li>随着时间的推移,人们在 C 语言的基础上增加了面向对象的机制(<a href="https://zh.wikipedia.org/wiki/%E8%BD%AF%E4%BB%B6%E5%8D%B1%E6%9C%BA" target="_blank" rel="noreferrer">软件危机</a>),形成了一门新的编程语言,它的名字是 C++ 。</li><li>但是C++ 的特性实在是太多了(因为 C++ 兼容 C并增加了很多自己独有的特性可以是当今最复杂的编程语言没有之一于是人们在 C++ 的基础上,删减了一些非必要的特性,就形成了 Java 和 C# ,也可以认为 Java 和 C# 是 C++--。</li><li>当然近年来Go 语言也很火,它的设计者之一就是 <code>Unix</code> 操作系统的的开发者<code>肯·汤姆森</code>Ken ThompsonGo 诞生的背景据说是<code>肯·汤姆森</code>Ken Thompson在 C++ 委员会在为其演讲 C++ 新特性的时候,觉得 C++ 新特性太多太复杂,于是就开发了 Go 语言所以Go 语言中有很多 C 语言的身影。</li><li>其实,在 C 语言之后的许多编程语言,或多或少都参考了 C 语言;所以,编程界流传了一句话:汇编生 C C 生万物。</li></ul></div><ul><li><code>学习 C 语言有助于快速上手其他编程语言</code>C++(原先是 C 语言的一个扩展,在 C 语言的基础上嫁接了面向对象编程思想、C#、Java 等,这些语言都继承或深受 C 语言的影响和启发。</li><li>⑤ C 语言长盛不衰。<code>C 语言至今,依然是最广泛使用、最流行的编程语言之一</code>,包括很多大学将 C 语言作为计算机教学的入门语言,拥有庞大而活跃的用户社区,这意味着有许多资源和库可供开发人员使用。</li></ul><h2 id="_3-3-计算机语言排行榜" tabindex="-1">3.3 计算机语言排行榜 <a class="header-anchor" href="#_3-3-计算机语言排行榜" aria-label="Permalink to &quot;3.3 计算机语言排行榜&quot;"></a></h2><ul><li><a href="https://www.tiobe.com/tiobe-index/" target="_blank" rel="noreferrer">TIOBE</a> 是一个流行编程语言排行每月更新。排名权重基于世界范围内工程师数量Google、Bing、Yahoo! 、Wikipedia、Amazon、Youtube 和百度这些主流的搜索引擎,也将作为排名权重的参考指标。</li></ul><p><img src="/c/assets/22.DFQhcDgs.png" alt=""></p><ul><li>计算机语言走势图:</li></ul><p><img src="/c/assets/23.Cco1vsW8.png" alt=""></p><h2 id="_3-4-c-语言的版本选择" tabindex="-1">3.4 C 语言的版本选择 <a class="header-anchor" href="#_3-4-c-语言的版本选择" aria-label="Permalink to &quot;3.4 C 语言的版本选择&quot;"></a></h2><ul><li><p>随着微型计算机的日益普及,出现了许多 C 语言版本(标准):</p><ul><li>版本 1KR CK&amp;R C 指的是 C 语言的原始版本。1978年C 语言的发明者布莱恩·柯林Brian <code>K</code>ernighan和丹尼斯·里奇Dennis <code>R</code>itchie合写了一本著名的教材《C 编程语言》The C programming language</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>由于 C 语言还没有成文的语法标准,这本书就成了公认标准,以两位作者的姓氏首字母作为版本简称 “K&amp;R C”。</p></div><ul><li><p>版本 2ANSI C又称 C89 或 C90C 语言的原始版本非常简单,对很多情况的描述非常模糊,加上 C 语法依然在快速发展,要求将 C 语言标准化的呼声越来越高。1989 年美国国家标准协会ANSI制定了一套 C 语言标准并于次年被国际标准化组织ISO通过。它被称为 “ANSI C”也可以按照发布年份称为 “C89 或 C90”。</p></li><li><p>版本 3C99C 语言标准的第一次<code>大型修订</code>,发生在 1999 年,增加了许多语言特性,比如:双斜杠( // )的注释语法,可变长度数组、灵活的数组成员、复数、内联函数和指定的初始值设定项,这个版本称为 C99<code>是目前最流行的 C 版本</code></p></li><li><p>版本 4C112011 年,标准化组织再一次对 C 语言进行修订增加了_Generic、static_assert 和原子类型限定符。这个版本称为 C11。</p></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>需要强调的是,修订标准的原因并不是因为原标准不能用,而是需要跟进新的技术。</p></div><ul><li>版本 5C17C11 标准在 2017 年进行了修补,但发布是在 2018 年。新版本只是解决了 C11 的一些缺陷,没有引入任何新功能。这个版本称为 C17。</li><li>版本 6C232023 年发布,计划进一步增强安全性,消除实现定义的行为,引入模块化语言概念等新特性,使 C 语言在安全和可靠性方面有重大提高。</li><li>……</li></ul></li></ul><h1 id="第四章-c-语言的学习技巧" tabindex="-1">第四章C 语言的学习技巧 <a class="header-anchor" href="#第四章-c-语言的学习技巧" aria-label="Permalink to &quot;第四章C 语言的学习技巧&quot;"></a></h1><h2 id="_4-1-概述" tabindex="-1">4.1 概述 <a class="header-anchor" href="#_4-1-概述" aria-label="Permalink to &quot;4.1 概述&quot;"></a></h2><ul><li>对于大部分的初学者, 学习 C 语言的目的可能是为了成为一名合格的程序员,开发出优秀的软件。但是,在学习了 C 语言的基本语法后,却发现只能在<code>控制台</code><code>黑底白字</code>)上玩玩,没有漂亮的用户界面以及人性化的交互。于是,开始学习数据结构、算法、数据库、操作系统,越陷越深,越来越迷茫,不知道学习 C 语言能做什么,认为学习编程很难,开始怀疑自己,直到放弃!!!</li><li>其实C 语言本身就是一门非常简单的语言,提供的实用功能不多,大部分的时候需要<code>借助</code>操作系统、第三方库以及以及一些硬件才能发挥它的威力!!!</li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li>① 学习 C 语言仅仅是让你踏上程序员之路的第一步而已,只学习 C 语言也做不了什么。</li><li>② 系统、扎实的学习 C 语言可以让你了解底层硬件、一些简单的数据结构和算法,并培养计算机思维。</li></ul></div><ul><li>C 语言是一门通用性的语言并没有针对某个领域进行优化在实际项目中C 语言主要用于比较底层的开发,例如: <ul><li>Windows、Linux、Unix 等操作系统的内核 90% 以上都使用 C 语言开发Rust 语言有望未来,在操作系统开发中占据一席之地,特别是在对安全性和性能要求极高的领域)。</li><li>开发硬件驱动,让硬件和操作系统连接起来,这样用户才能更有效的使用硬件。</li><li>单片机和嵌入式属于软硬件的结合,是使用 C 语言最多的地方。</li><li>开发系统组件或服务,用于支撑上层应用。</li><li>……</li></ul></li><li>既然 C 语言的应用很多,为什么感觉学习它还是做不了什么?答案就是<code>生态</code></li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>现代化的高级编程语言的流行程度,除了和编程语言的设计是否优秀有关,最主要的原因就是<code>生态</code></p><ul><li>① 很多编程语言都自带<code>标准库</code>语言本身提供的开箱即用Java、Go 等。</li><li>② 很多编程语言都有自己的<code>包管理器</code>用于管理第三方库解决方案Java 中的 Maven、Gradle、Go 中的 go modules JavaScript 的 npm 等。</li></ul><p>遗憾的是C 语言的<code>标准库</code>非常简单,只有<code>输入输出</code><code>文件操作</code><code>日期时间</code><code>字符串处理</code><code>内存管理</code>,对于<code>网络编程</code><code>GUI</code><code>数据库</code><code>并发</code><code>需要</code>大量的<code>第三方库</code>来扩展 C 语言的功能Java 语言、Go 语言等其他的现代化高级编程语言都是直接将这些常见的开发场景内置到标准库中极大的降低了软件开发的难度。C 语言的<code>第三方库</code>非常稀少,更别提缺少自己的包管理器。</p><p>不过,现在 C 语言社区也开始诞生了一些包管理器Conan 和 vcpkg 也有自己的项目构建工具cmake 、xmake 等。</p></div><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>JavaScript 的作者 Brendan Eich布兰登·艾奇 曾经这么说:“与其说我爱 JavaScript不如说我恨它。它是 C 语言和 Self 语言一夜情的产物(致敬 C 语言)。十八世纪英国文学家约翰逊博士说得好:&quot;它的优秀之处并非原创,它的原创之处并不优秀。&quot;</p></div><h2 id="_4-2-项目构建工具和包管理器" tabindex="-1">4.2 项目构建工具和包管理器 <a class="header-anchor" href="#_4-2-项目构建工具和包管理器" aria-label="Permalink to &quot;4.2 项目构建工具和包管理器&quot;"></a></h2><h3 id="_4-2-1-概述" tabindex="-1">4.2.1 概述 <a class="header-anchor" href="#_4-2-1-概述" aria-label="Permalink to &quot;4.2.1 概述&quot;"></a></h3><ul><li><code>项目构建工具</code><code>包管理器</code>在软件开发中扮演着不同的角色,它们虽然有时会有重叠的功能,但主要关注的点是不同的。</li></ul><h3 id="_4-2-2-项目构建工具" tabindex="-1">4.2.2 项目构建工具 <a class="header-anchor" href="#_4-2-2-项目构建工具" aria-label="Permalink to &quot;4.2.2 项目构建工具&quot;"></a></h3><ul><li><code>项目构建工具</code>是用于<code>自动化编译、测试、打包、部署</code>等一系列任务的软件工具。它们帮助开发者简化和管理整个软件开发生命周期中的各个步骤,尤其是在构建过程中的复杂性管理上。</li><li>其功能有: <ul><li>编译代码:自动编译源代码(如 <code>.java</code><code>.c</code> 等)为可执行文件或中间文件(如:<code>.class</code> 文件)。</li><li>运行测试:集成单元测试、集成测试,自动运行测试用例并生成报告。</li><li>打包将编译后的代码、依赖库、资源文件等打包成可分发的格式JAR、WAR、可执行文件等</li><li>依赖管理:自动下载、更新和管理项目所需的第三方库(这部分功能有时与包管理器重叠)。</li><li>部署:将打包后的应用程序自动部署到测试环境、生产环境等。</li><li>任务自动化:除了基本的构建流程外,还可以自动化执行一些常见任务,如:代码检查、文档生成等。</li></ul></li><li>常用的项目构建工具: <ul><li>MavenJava一个流行的构建工具和依赖管理工具广泛用于 Java 项目。</li><li>GradleJava、Kotlin、Groovy一个灵活的构建工具支持声明式的构建脚本和多种语言。</li><li>MakeC/C++):一个经典的构建工具,使用 <code>Makefile</code> 来定义构建规则和依赖关系。</li><li><s>AntJava早期流行的 Java 构建工具,通过 XML 配置文件定义构建过程。</s></li><li>CMakeC/C++一个跨平台的构建系统帮助生成标准的构建文件Makefile 或 Visual Studio 项目文件。</li></ul></li></ul><h3 id="_4-2-3-包管理器" tabindex="-1">4.2.3 包管理器 <a class="header-anchor" href="#_4-2-3-包管理器" aria-label="Permalink to &quot;4.2.3 包管理器&quot;"></a></h3><ul><li><code>包管理器</code>是用于<code>自动化安装、更新、配置</code><code>管理软件包及其依赖关系</code>的工具。它主要关注于获取和管理项目所需的第三方库或工具包,并确保它们正确地集成到项目中。</li><li>其功能有: <ul><li>依赖管理:根据项目配置文件(如:<code>package.json</code><code>requirements.txt</code>)自动下载和安装项目所需的依赖包。</li><li>版本控制:管理包的版本,允许开发者指定某个特定版本或版本范围,确保项目中的库版本一致性。</li><li>包的发布和共享:开发者可以通过包管理器发布自己的库,并且共享给社区或组织内部的其他项目使用。</li><li>环境隔离:有些包管理器提供虚拟环境功能,可以将不同项目的依赖隔离开,避免版本冲突。</li><li>更新和卸载:包管理器可以自动更新依赖包到最新的兼容版本或卸载不再需要的包。</li></ul></li><li>常见的包管理器: <ul><li>npmNode.js用于管理 JavaScript 和 Node.js 项目的包和模块。</li><li>pipPython用于安装和管理 Python 的软件包。</li><li>ComposerPHP用于管理 PHP 项目的依赖库。</li><li>NuGet.NET用于管理 .NET 平台上的包和库。</li><li>RubyGemsRuby用于管理 Ruby 的库和工具包。</li><li>CargoRustRust 编程语言的包管理器和构建工具。</li><li>YarnJavaScript是 npm 的替代品,提供更快和更可靠的包管理体验。</li><li>HomebrewmacOS用于 macOS 系统下的命令行工具和库的管理。</li></ul></li></ul><h3 id="_4-2-3-注意事项" tabindex="-1">4.2.3 注意事项 <a class="header-anchor" href="#_4-2-3-注意事项" aria-label="Permalink to &quot;4.2.3 注意事项&quot;"></a></h3><ul><li>对于 <code>Java</code> 项目中的 <code>Maven</code><code>Gradle</code> 而言,其不仅是<code>项目构建工具</code>也是<code>包管理工具</code></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① Gradle 也支持原生项目的开发C 和 C++ 。</li><li>② 不过,业界开发 C/C++ 项目的项目构建工具和包管理器,通常使用 Cmake 和 Conan 。</li></ul></div><h1 id="第五章-附录" tabindex="-1">第五章:附录 <a class="header-anchor" href="#第五章-附录" aria-label="Permalink to &quot;第五章:附录&quot;"></a></h1><h2 id="_5-1-嵌入式领域中的-c-语言" tabindex="-1">5.1 嵌入式领域中的 C 语言 <a class="header-anchor" href="#_5-1-嵌入式领域中的-c-语言" aria-label="Permalink to &quot;5.1 嵌入式领域中的 C 语言&quot;"></a></h2><h3 id="_5-1-1-概述" tabindex="-1">5.1.1 概述 <a class="header-anchor" href="#_5-1-1-概述" aria-label="Permalink to &quot;5.1.1 概述&quot;"></a></h3><ul><li>C 语言在 C51、STM32 和 ARM 平台上的应用场景非常广泛,涵盖了各种嵌入式系统的开发需求。</li></ul><h3 id="_5-1-2-c51-8051-系列微控制器" tabindex="-1">5.1.2 C518051 系列微控制器) <a class="header-anchor" href="#_5-1-2-c51-8051-系列微控制器" aria-label="Permalink to &quot;5.1.2 C518051 系列微控制器)&quot;"></a></h3><ul><li><code>背景</code>8051 是由 Intel 于 1980 年设计的一种 8 位微控制器架构。它具有指令集简单、结构紧凑的特点,广泛应用于低端嵌入式系统中。</li><li><code>开发工具</code>C51 是指针对 8051 系列微控制器的 C 语言编译器Keil C51。这种编译器将 C 语言代码编译为适合 8051 架构的汇编代码。</li><li><code>C 语言的作用</code>C 语言在 8051 微控制器上的应用使得开发更加高效和可维护。尽管 8051 的硬件资源有限,但 C 语言仍然能够在不损失性能的前提下提供高级编程的便利。</li><li><code>应用场景</code> <ul><li><strong>简单的控制系统</strong>:家用电器(微波炉、洗衣机、空调)的控制板等。这些设备通常不需要复杂的运算能力,但要求可靠和稳定的控制。</li><li><strong>低功耗传感器接口</strong>C51 微控制器常用于低功耗传感器的数据采集和传输,如:温度、湿度、压力传感器。</li><li><strong>工业自动化设备</strong>:用于简单的工业自动化控制,如:小型电机驱动、工业传感器数据处理和传输。</li><li><strong>电子玩具</strong>:许多简单的电子玩具使用 8051 系列微控制器来控制声音、LED 灯光、显示屏等。</li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>总结C51 微控制器适用于资源受限、需要低成本的简单控制系统,非常适合使用 C 语言来进行开发!!!</p></div><h3 id="_5-1-3-stm32-stm32-系列微控制器" tabindex="-1">5.1.3 STM32STM32 系列微控制器) <a class="header-anchor" href="#_5-1-3-stm32-stm32-系列微控制器" aria-label="Permalink to &quot;5.1.3 STM32STM32 系列微控制器)&quot;"></a></h3><ul><li><code>背景</code>STM32 是意法半导体STMicroelectronics推出的一系列基于 ARM Cortex-M 内核的 32 位微控制器。它们广泛用于需要高性能和低功耗的嵌入式应用中,如:工业控制、消费电子和物联网设备。</li><li><code>开发工具</code>:开发 STM32 微控制器通常使用 Keil、IAR Embedded Workbench 或 STM32CubeIDE 等开发环境。这些环境中使用的编程语言主要是 C有时也包括 C++)。</li><li><code>C 语言的作用</code>C 语言在 STM32 上的应用非常广泛,开发者可以利用它直接控制硬件寄存器,同时也能方便地使用 STM32 提供的 HAL硬件抽象层库或 LL低层库进行开发。C 语言在这个平台上不仅能实现底层控制,还能编写复杂的应用逻辑。</li><li><code>应用场景</code> <ul><li><strong>物联网IoT设备</strong>STM32 微控制器常用于各种物联网设备智能家居控制系统、环境监测设备、可穿戴设备等。这些设备通常需要低功耗和强大的处理能力并且需要支持多种通信协议Wi-Fi、Bluetooth、LoRa。</li><li><strong>消费电子</strong>:智能手表、健身追踪器、电子书阅读器、无人机等,这些设备需要具备实时处理能力、低功耗和良好的外设支持。</li><li><strong>医疗设备</strong>STM32 微控制器被广泛应用于便携式医疗设备中,如:血糖监测仪、心率监测器、便携式超声设备等,这些设备需要精确的传感器数据采集和处理。</li><li><strong>工业自动化控制</strong>PLC可编程逻辑控制器、工业机器人、伺服电机控制等STM32 能够处理复杂的控制算法和实时任务。</li><li><strong>汽车电子</strong>:用于汽车中的传感器管理、车载信息娱乐系统、车身控制系统(车窗、电动座椅调节等)。</li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>总结STM32 微控制器在物联网、消费电子、医疗设备和工业控制等领域表现出色,非常适合使用 C 语言来进行开发,因为 C 语言允许直接进行硬件控制并支持复杂的应用开发。</p></div><h3 id="_5-1-3-arm-架构-特别是-arm-cortex-系列" tabindex="-1">5.1.3 ARM 架构(特别是 ARM Cortex 系列) <a class="header-anchor" href="#_5-1-3-arm-架构-特别是-arm-cortex-系列" aria-label="Permalink to &quot;5.1.3 ARM 架构(特别是 ARM Cortex 系列)&quot;"></a></h3><ul><li><code>背景</code>ARM 是一种广泛使用的处理器架构特别是在嵌入式系统中ARM Cortex 系列处理器(如 Cortex-M、Cortex-R 和 Cortex-A非常流行。Cortex-M 系列主要用于微控制器Cortex-R 用于实时系统Cortex-A 则用于高性能嵌入式系统。</li><li><code>开发工具</code>:针对 ARM 架构的开发,常用工具包括 ARM Keil MDK、IAR、GCC for ARM 和 ARM Development Studio。这些工具均支持使用 C 语言进行开发。</li><li><code>C 语言的作用</code>C 语言在 ARM 架构上的应用广泛。它被用于操作系统内核(如 FreeRTOS、Zephyr、设备驱动、应用层逻辑等。在 ARM Cortex-M 和 Cortex-R 系列中C 语言的高效性和低级别硬件访问能力是开发实时、低延迟系统的关键。</li><li><code>应用场景</code> <ul><li><strong>高级嵌入式操作系统</strong>ARM Cortex-A 系列处理器广泛用于运行 Linux、Android 等操作系统的嵌入式设备,如:智能手机、平板电脑、智能电视和车载娱乐系统。</li><li><strong>实时系统</strong>ARM Cortex-R 系列处理器用于实时系统,如:汽车的 ABS防抱死制动系统、ESC电子稳定控制系统以及航空电子设备这些系统要求极低的延迟和高可靠性。</li><li><strong>高性能物联网网关</strong>Cortex-A 系列处理器可以用来开发支持多协议、多设备管理的物联网网关,这些网关通常需要强大的计算能力和多线程处理能力。</li><li><strong>边缘计算设备</strong>在边缘计算场景中ARM Cortex-A 处理器用于执行本地数据处理和决策,如:视频分析、图像处理、语音识别等。</li><li><strong>智能家居设备</strong>ARM Cortex-M 系列微控制器广泛应用于智能家居产品,如:智能灯泡、智能音箱、家庭安全系统,这些设备需要高效的处理能力和低功耗。</li><li><strong>机器人控制系统</strong>ARM Cortex-M 和 Cortex-A 系列处理器用于机器人系统的控制和通信,如:无人机、工业机器人、服务机器人等,处理复杂的运动控制、路径规划和传感器数据融合。</li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>总结ARM Cortex 系列适用于从实时系统到高级嵌入式操作系统的各类应用,支持从低功耗控制到高性能计算的多种需求,非常适合使用 C 语言来进行开发,因为 C 语言不仅用于控制硬件,还广泛应用于操作系统和应用程序的开发。</p></div></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><div class="edit-info" data-v-e257564d><!----><div class="last-updated" data-v-e257564d><p class="VPLastUpdated" data-v-e257564d data-v-e98dd255>上次更新: <time datetime="2024-08-11T04:50:40.000Z" data-v-e98dd255></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><!----></div><div class="pager" data-v-e257564d><a class="VPLink link pager-link next" href="/c/notes/01_c-basic/01_xdx/" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>下一篇</span><span class="title" data-v-e257564d>C 语言入门</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-5d98c3a5 data-v-e315a0ad><div class="container" data-v-e315a0ad><p class="message" data-v-e315a0ad>Released under the MIT License.</p><p class="copyright" data-v-e315a0ad>Copyright © 2024 许大仙</p></div></footer><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DynzO91I\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DEs09TjE\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
</body>
</html>

View File

@ -8,11 +8,11 @@
<meta name="generator" content="VitePress v1.3.2">
<link rel="preload stylesheet" href="/c/assets/style.8enJ9bsK.css" as="style">
<script type="module" src="/c/assets/app.DS7FIVmo.js"></script>
<script type="module" src="/c/assets/app.DOv65PSF.js"></script>
<link rel="preload" href="/c/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
<link rel="modulepreload" href="/c/assets/chunks/theme.BqwVBBaA.js">
<link rel="modulepreload" href="/c/assets/chunks/theme.CfoaGUmH.js">
<link rel="modulepreload" href="/c/assets/chunks/framework.CZRoMP2i.js">
<link rel="modulepreload" href="/c/assets/notes_01_c-basic_01_xdx_index.md.DynzO91I.lean.js">
<link rel="modulepreload" href="/c/assets/notes_01_c-basic_01_xdx_index.md.DEs09TjE.lean.js">
<link rel="shortcut icon" href="/c//logo.svg">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,shrink-to-fit=no">
<meta name="keywords" content="许大仙,许大仙的博客">
@ -20,7 +20,9 @@
<script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
</head>
<body>
<div id="app"><div class="Layout" data-v-5d98c3a5><!--[--><!--]--><!--[--><span tabindex="-1" data-v-0f60ec36></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-0f60ec36> Skip to content </a><!--]--><!----><header class="VPNav" data-v-5d98c3a5 data-v-ae24b3ad><div class="VPNavBar has-sidebar top" data-v-ae24b3ad data-v-6aa21345><div class="wrapper" data-v-6aa21345><div class="container" data-v-6aa21345><div class="title" data-v-6aa21345><div class="VPNavBarTitle has-sidebar" data-v-6aa21345 data-v-ab179fa1><a class="title" href="/c/" data-v-ab179fa1><!--[--><!--]--><!--[--><img class="VPImage logo" src="/c/logo.svg" alt data-v-8426fc1a><!--]--><span data-v-ab179fa1>许大仙</span><!--[--><!--]--></a></div></div><div class="content" data-v-6aa21345><div class="content-body" data-v-6aa21345><!--[--><!--]--><div class="VPNavBarSearch search" data-v-6aa21345><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><span class="vp-icon DocSearch-Search-Icon"></span><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-6aa21345 data-v-dc692963><span id="main-nav-aria-label" class="visually-hidden" data-v-dc692963> Main Navigation </span><!--[--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/" target="_blank" rel="noreferrer" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>首页</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/coa6/notes/" target="_blank" rel="noreferrer" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>计组6件套</span><!--]--></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-dc692963 data-v-b6c34ac9><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-b6c34ac9><span class="text" data-v-b6c34ac9><!----><span data-v-b6c34ac9>编程语言</span><span class="vpi-chevron-down text-icon" data-v-b6c34ac9></span></span></button><div class="menu" data-v-b6c34ac9><div class="VPMenu" data-v-b6c34ac9 data-v-b98bc113><div class="items" data-v-b98bc113><!--[--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link" href="/c/notes/" data-v-43f1e123><!--[-->c/c++<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/web-design/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->前端<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/java/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->Java<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/big-data/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->大数据<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/linux/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->云原生<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/go/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->Go<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/python/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->Python<!--]--></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/open-software/notes/" target="_blank" rel="noreferrer" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>开源软件</span><!--]--></a><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-6aa21345 data-v-6c893767><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-6c893767 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-6aa21345 data-v-0394ad82 data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/Aurorxa" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-eee4e7cb><span class="vpi-social-github" /></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-6aa21345 data-v-bb2aa2f0 data-v-b6c34ac9><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-b6c34ac9><span class="vpi-more-horizontal icon" data-v-b6c34ac9></span></button><div class="menu" data-v-b6c34ac9><div class="VPMenu" data-v-b6c34ac9 data-v-b98bc113><!----><!--[--><!--[--><!----><div class="group" data-v-bb2aa2f0><div class="item appearance" data-v-bb2aa2f0><p class="label" data-v-bb2aa2f0>Appearance</p><div class="appearance-action" data-v-bb2aa2f0><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-bb2aa2f0 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div></div></div><div class="group" data-v-bb2aa2f0><div class="item social-links" data-v-bb2aa2f0><div class="VPSocialLinks social-links-list" data-v-bb2aa2f0 data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/Aurorxa" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-eee4e7cb><span class="vpi-social-github" /></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-6aa21345 data-v-e5dd9c1c><span class="container" data-v-e5dd9c1c><span class="top" data-v-e5dd9c1c></span><span class="middle" data-v-e5dd9c1c></span><span class="bottom" data-v-e5dd9c1c></span></span></button></div></div></div></div><div class="divider" data-v-6aa21345><div class="divider-line" data-v-6aa21345></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-5d98c3a5 data-v-a6f0e41e><div class="container" data-v-a6f0e41e><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-a6f0e41e><span class="vpi-align-left menu-icon" data-v-a6f0e41e></span><span class="menu-text" data-v-a6f0e41e>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-a6f0e41e data-v-17a5e62e><button data-v-17a5e62e>返回顶部</button><!----></div></div></div><aside class="VPSidebar" data-v-5d98c3a5 data-v-319d5ca6><div class="curtain" data-v-319d5ca6></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-319d5ca6><span class="visually-hidden" id="sidebar-aria-label" data-v-319d5ca6> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible has-active" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h2 class="text" data-v-b7550ba0>C 语言基础</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/00_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>编程基础</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>C 语言入门</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/02_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>变量和进制</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/03_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>数据类型和运算符</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/04_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>流程控制</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/05_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>数组</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/06_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>指针</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/07_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>函数</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/08_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>预处理器</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/09_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>自定义数据类型</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/10_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>字符串和时间</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/11_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>内存管理</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/12_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>文件操作</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/13_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>调试工具和调试技巧gdb和make</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/14_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>常用库函数</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h2 class="text" data-v-b7550ba0>C 语言高级</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>变量和内存分布</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/02_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>指针强化</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/03_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>结构体和文件的高级用法</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/04_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>链表和回调函数</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/05_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>编译过程和面向接口</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h2 class="text" data-v-b7550ba0>项目构建工具</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><section class="VPSidebarItem level-1 collapsible collapsed" data-v-b7550ba0 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h3 class="text" data-v-b7550ba0>meson</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-2 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/03_build/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Gradle 入门</p><!--]--></a><!----></div><!----></div><!--]--></div></section><section class="VPSidebarItem level-1 collapsible collapsed" data-v-b7550ba0 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h3 class="text" data-v-b7550ba0>cmake</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-2 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/03_build/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Gradle 入门</p><!--]--></a><!----></div><!----></div><!--]--></div></section><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/03_build/01_${commonDirectoryName}/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>conan </p><!--]--></a><!----></div><!----></div><section class="VPSidebarItem level-1 collapsible collapsed" data-v-b7550ba0 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h3 class="text" data-v-b7550ba0>Gradle</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-2 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/03_build/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Gradle 入门</p><!--]--></a><!----></div><!----></div><!--]--></div></section><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h2 class="text" data-v-b7550ba0>Linux</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/04_linux/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Linux 初识和安装</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><div class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><p class="text" data-v-b7550ba0>C++ 核心编程</p><!----></div><!----></div></div><div class="no-transition group" data-v-c40bc020><div class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><p class="text" data-v-b7550ba0>C++ 标准库</p><!----></div><!----></div></div><div class="no-transition group" data-v-c40bc020><div class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><p class="text" data-v-b7550ba0>QT 桌面开发</p><!----></div><!----></div></div><div class="no-transition group" data-v-c40bc020><div class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><p class="text" data-v-b7550ba0>Linux 高并发服务器开发</p><!----></div><!----></div></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-5d98c3a5 data-v-1428d186><div class="VPDoc has-sidebar has-aside" data-v-1428d186 data-v-39a288b8><!--[--><!--]--><div class="container" data-v-39a288b8><div class="aside" data-v-39a288b8><div class="aside-curtain" data-v-39a288b8></div><div class="aside-container" data-v-39a288b8><div class="aside-content" data-v-39a288b8><div class="VPDocAside" data-v-39a288b8 data-v-3f215769><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-3f215769 data-v-a5bbad30><div class="content" data-v-a5bbad30><div class="outline-marker" data-v-a5bbad30></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-a5bbad30>目录</div><ul class="VPDocOutlineItem root" data-v-a5bbad30 data-v-b933a997><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-3f215769></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-39a288b8><div class="content-container" data-v-39a288b8><!--[--><!--]--><main class="main" data-v-39a288b8><div style="position:relative;" class="vp-doc _c_notes_01_c-basic_01_xdx_" data-v-39a288b8><div><h1 id="第一章-开发环境的安装和配置-⭐" tabindex="-1">第一章:开发环境的安装和配置(⭐) <a class="header-anchor" href="#第一章-开发环境的安装和配置-⭐" aria-label="Permalink to &quot;第一章:开发环境的安装和配置(⭐)&quot;"></a></h1><h2 id="_1-1-环境的安装和配置" tabindex="-1">1.1 环境的安装和配置 <a class="header-anchor" href="#_1-1-环境的安装和配置" aria-label="Permalink to &quot;1.1 环境的安装和配置&quot;"></a></h2><h3 id="_1-1-1-概述" tabindex="-1">1.1.1 概述 <a class="header-anchor" href="#_1-1-1-概述" aria-label="Permalink to &quot;1.1.1 概述&quot;"></a></h3><ul><li>要开发 C/C++ 程序,需要安装 C/C++ 编译器,目前有两种主流实现,即: <ul><li>GCCGNU Compiler Collection全平台实现即支持 Windows、MacOS、Linux 等。</li><li>MSVCMicrosoft Visual C++):只支持 Windows 系统。</li></ul></li><li>GCC 在 Windows 上的版本有很多,如:<a href="https://www.mingw-w64.org/" target="_blank" rel="noreferrer">MinGW-w64</a><a href="https://cygwin.com/" target="_blank" rel="noreferrer">Gygwin</a><a href="https://www.msys2.org/" target="_blank" rel="noreferrer">MSYS2</a>。它们之间的区别,如下所示:</li></ul><table tabindex="0"><thead><tr><th>特性</th><th>MinGW-w64</th><th>Cygwin</th><th>MSYS2</th></tr></thead><tbody><tr><td><strong>简介</strong></td><td>Minimalist GNU for Windows</td><td>POSIX 兼容环境和工具集</td><td>结合了 MinGW 和 Cygwin 的工具集</td></tr><tr><td><strong>编译器</strong></td><td>提供 GCC 编译器</td><td>提供 POSIX 兼容环境,包含大量工具</td><td>提供 MinGW-w64 工具链和 Cygwin 环境</td></tr><tr><td><strong>生成文件</strong></td><td>Windows 原生可执行文件</td><td>POSIX 兼容的可执行文件</td><td>可以生成 Windows 原生可执行文件或 POSIX 文件</td></tr><tr><td><strong>依赖</strong></td><td>无需额外依赖</td><td>依赖 Cygwin DLL</td><td>根据使用工具链决定MinGW-w64 无依赖Cygwin 有依赖)</td></tr><tr><td><strong>工具和库</strong></td><td>基本的编译工具</td><td>丰富的 Unix 工具和库</td><td>丰富的工具和库,强大的包管理系统</td></tr><tr><td><strong>性能</strong></td><td>性能较好</td><td>可能较低,因为通过兼容层调用系统</td><td>取决于使用的工具链MinGW-w64 性能较好)</td></tr><tr><td><strong>复杂度</strong></td><td>简单易用</td><td>设置和使用相对复杂</td><td>较为灵活,复杂度介于 MinGW-w64 和 Cygwin 之间</td></tr><tr><td><strong>适用场景</strong></td><td>开发 Windows 原生应用</td><td>运行和开发 Unix 程序</td><td>混合使用 Unix 工具和开发 Windows 原生应用</td></tr><tr><td><strong>优点</strong></td><td>轻量级,直接生成 Windows 应用</td><td>完整的 POSIX 兼容环境,丰富的工具</td><td>灵活的环境,强大的包管理系统</td></tr><tr><td><strong>缺点</strong></td><td>工具和库较少</td><td>生成文件依赖 Cygwin DLL性能可能较低</td><td>环境较大,占用更多空间,复杂性比 MinGW-w64 高</td></tr></tbody></table><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① MinGW-w64 、Cygwin 以及 MSYS2 任选其一安装即可。</li><li>② 目前的 Win10 和 Win11 版本支持 WSL2 Windows Sub Linux 2 ,即 Windows 的子系统 Linux可以实现在 Windows 系统上安装一个 Linux ,然后再运行 Linux 中的 GCC 工具链。</li></ul></div><h3 id="_1-1-2-mingw-w64-的安装和配置" tabindex="-1">1.1.2 MinGW-w64 的安装和配置 <a class="header-anchor" href="#_1-1-2-mingw-w64-的安装和配置" aria-label="Permalink to &quot;1.1.2 MinGW-w64 的安装和配置&quot;"></a></h3><h4 id="_1-1-2-1-安装" tabindex="-1">1.1.2.1 安装 <a class="header-anchor" href="#_1-1-2-1-安装" aria-label="Permalink to &quot;1.1.2.1 安装&quot;"></a></h4><ul><li>下载到本地:略。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>下载地址在<a href="https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-posix-seh-ucrt-rt_v11-rev1.7z" target="_blank" rel="noreferrer">这里</a></p></div><p><img src="/c/assets/1.D60Zf6_d.png" alt=""></p><ul><li>解压到指定的目录,即:</li></ul><p><img src="/c/assets/2.D2-G6nV2.png" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>本人的解压目录是:<code>D:\develop\mingw64</code></p></div><h4 id="_1-1-2-2-配置-path-环境变量" tabindex="-1">1.1.2.2 配置 path 环境变量 <a class="header-anchor" href="#_1-1-2-2-配置-path-环境变量" aria-label="Permalink to &quot;1.1.2.2 配置 path 环境变量&quot;"></a></h4><ul><li>配置环境变量,以便任意目录都可以执行 gcc 命令,即:</li></ul><p><img src="/c/assets/3.DpzkVk5V.png" alt=""></p><p><img src="/c/assets/4.BXk95GIP.png" alt=""></p><p><img src="/c/assets/5.CbWTB08W.png" alt=""></p><p><img src="/c/assets/6.twO9TCIg.png" alt=""></p><p><img src="/c/assets/7.CKOjeIvS.png" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>因为,本人安装 MinGW-w64 的目录是 <code>D:\develop\mingw64</code>,所以配置 path 环境变量就需要 <code>D:\develop\mingw64\bin</code></p></div><p><img src="/c/assets/8.DKmR0CxE.png" alt=""></p><ul><li>测试是否安装成功:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --version</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/9.Cudf77_s.gif" alt=""></p><h3 id="_1-1-3-cygwin-的安装和配置" tabindex="-1">1.1.3 Cygwin 的安装和配置 <a class="header-anchor" href="#_1-1-3-cygwin-的安装和配置" aria-label="Permalink to &quot;1.1.3 Cygwin 的安装和配置&quot;"></a></h3><h4 id="_1-1-3-1-安装" tabindex="-1">1.1.3.1 安装 <a class="header-anchor" href="#_1-1-3-1-安装" aria-label="Permalink to &quot;1.1.3.1 安装&quot;"></a></h4><ul><li>下载到本地:略。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>下载地址在<a href="https://www.cygwin.com/install.html" target="_blank" rel="noreferrer">这里</a></p></div><p><img src="/c/assets/10.BBUUlhRC.png" alt=""></p><ul><li>点击安装:</li></ul><p><img src="/c/assets/11.iLABkB7O.png" alt=""></p><p><img src="/c/assets/12.BQuYWOU9.png" alt=""></p><p><img src="/c/assets/13.CslpH6j0.png" alt=""></p><p><img src="/c/assets/14.BAyvZdKq.png" alt=""></p><p><img src="/c/assets/15.C3oC1iUd.png" alt=""></p><p><img src="/c/assets/16.Ds-jsEZn.png" alt=""></p><p><img src="/c/assets/17.Cd37gMYs.png" alt=""></p><p><img src="/c/assets/18.CAw2z3gc.png" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>默认是最小化安装,没有 GCC需要选择 gcc-core、gcc-g++、make、gdb、binutils 。</p></div><p><img src="/c/assets/19.DdPThnr-.png" alt=""></p><p><img src="/c/assets/20.q_rvlDnY.png" alt=""></p><p><img src="/c/assets/21.JRHg9RZA.png" alt=""></p><p><img src="/c/assets/22.Baq-Hb06.png" alt=""></p><p><img src="/c/assets/23.c1ht53mu.png" alt=""></p><p><img src="/c/assets/24.CAZmH5Py.png" alt=""></p><p><img src="/c/assets/25.DWeCYBe9.png" alt=""></p><p><img src="/c/assets/26.2XM8pYni.png" alt=""></p><p><img src="/c/assets/27.CN0t-fuo.png" alt=""></p><h4 id="_1-1-3-2-配置-path-环境变量" tabindex="-1">1.1.3.2 配置 path 环境变量 <a class="header-anchor" href="#_1-1-3-2-配置-path-环境变量" aria-label="Permalink to &quot;1.1.3.2 配置 path 环境变量&quot;"></a></h4><ul><li><code>3.1.2.2 配置 path 环境变量</code> 步骤相同:略。</li></ul><h3 id="_1-1-4-msys2-推荐" tabindex="-1">1.1.4 MSYS2推荐 <a class="header-anchor" href="#_1-1-4-msys2-推荐" aria-label="Permalink to &quot;1.1.4 MSYS2推荐&quot;"></a></h3><h4 id="_1-1-4-1-安装" tabindex="-1">1.1.4.1 安装 <a class="header-anchor" href="#_1-1-4-1-安装" aria-label="Permalink to &quot;1.1.4.1 安装&quot;"></a></h4><ul><li>下载到本地:略。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>下载地址在<a href="https://www.msys2.org/" target="_blank" rel="noreferrer">这里</a></p></div><p><img src="/c/assets/28.AcDh3LXQ.png" alt=""></p><ul><li>点击安装:</li></ul><p><img src="/c/assets/29.CUkDFAc6.png" alt=""></p><p><img src="/c/assets/30.picNTNaJ.png" alt=""></p><p><img src="/c/assets/31.DKX92RgJ.png" alt=""></p><p><img src="/c/assets/32.Bxr7QKI3.png" alt=""></p><p><img src="/c/assets/33.DuFWsOgW.png" alt=""></p><ul><li>出现命令终端:</li></ul><p><img src="/c/assets/34.Da9qUcfr.png" alt=""></p><ul><li>替换清华镜像源(可选):</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sed</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -i</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;s#https\?://mirror.msys2.org/#https://mirrors.tuna.tsinghua.edu.cn/msys2/#g&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /etc/pacman.d/mirrorlist</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">*</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/35.7_gEABSX.gif" alt=""></p><ul><li>安装 gcc 等相关开发包:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pacman</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -Syu</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --noconfirm</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # 更新包管理器</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pacman</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -Sy</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> base-devel</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --noconfirm</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # 安装开发工具包</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pacman</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -Sy</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> mingw-w64-x86_64-toolchain</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --noconfirm</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # 安装开发 gcc 相关工具链</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/36.C2KQYoVC.gif" alt=""></p><h4 id="_1-1-4-2-配置-path-环境变量" tabindex="-1">1.1.4.2 配置 path 环境变量 <a class="header-anchor" href="#_1-1-4-2-配置-path-环境变量" aria-label="Permalink to &quot;1.1.4.2 配置 path 环境变量&quot;"></a></h4><ul><li><code>3.1.2.2 配置 path 环境变量</code> 步骤相同:略。</li></ul><h2 id="_1-2-ide-的安装和配置" tabindex="-1">1.2 IDE 的安装和配置 <a class="header-anchor" href="#_1-2-ide-的安装和配置" aria-label="Permalink to &quot;1.2 IDE 的安装和配置&quot;"></a></h2><h3 id="_1-2-1-clion" tabindex="-1">1.2.1 CLion <a class="header-anchor" href="#_1-2-1-clion" aria-label="Permalink to &quot;1.2.1 CLion&quot;"></a></h3><h4 id="_1-2-1-1-概述" tabindex="-1">1.2.1.1 概述 <a class="header-anchor" href="#_1-2-1-1-概述" aria-label="Permalink to &quot;1.2.1.1 概述&quot;"></a></h4><ul><li><a href="https://www.jetbrains.com/clion/" target="_blank" rel="noreferrer">CLion</a> 是一款由 JetBrains 推出的跨平台 C/C++ 集成开发环境IDE它具有智能编辑器、CMake 构建支持、调试器、单元测试、代码分析等功能,可以极大提高 C/C++ 开发效率。</li></ul><h4 id="_1-2-1-2-安装" tabindex="-1">1.2.1.2 安装 <a class="header-anchor" href="#_1-2-1-2-安装" aria-label="Permalink to &quot;1.2.1.2 安装&quot;"></a></h4><ul><li>鼠标双击,进入安装:</li></ul><p><img src="/c/assets/37.RTUP8Vtx.png" alt=""></p><ul><li>下一步:</li></ul><p><img src="/c/assets/38.Dq21DxwL.png" alt=""></p><ul><li>下一步:</li></ul><p><img src="/c/assets/39.QmpUaNxU.png" alt=""></p><ul><li>下一步:</li></ul><p><img src="/c/assets/40.DP0C29gZ.png" alt=""></p><ul><li>安装:</li></ul><p><img src="/c/assets/41.DwzHokd4.png" alt=""></p><ul><li>安装完成:</li></ul><p><img src="/c/assets/42.Bi6K26yA.png" alt=""></p><h4 id="_1-2-1-3-配置" tabindex="-1">1.2.1.3 配置 <a class="header-anchor" href="#_1-2-1-3-配置" aria-label="Permalink to &quot;1.2.1.3 配置&quot;"></a></h4><ul><li>打开 CLion </li></ul><p><img src="/c/assets/43.Bw8DcEQ_.png" alt=""></p><ul><li>安装中文插件(可选):</li></ul><p><img src="/c/assets/44.DPc8Z9rS.png" alt=""></p><p><img src="/c/assets/45.S84xHMTl.png" alt=""></p><ul><li>配置新 UI </li></ul><p><img src="/c/assets/46.iw3JQUkn.png" alt=""></p><p><img src="/c/assets/47.ILeJt-HK.png" alt=""></p><ul><li>新 UI 配置自定义字体(可选):</li></ul><p><img src="/c/assets/48.CHgm7khh.png" alt=""></p><ul><li>配置<code>自动保存</code>功能:</li></ul><p><img src="/c/assets/49.N1nqJaEg.png" alt=""></p><ul><li>配置<code>文件编码</code> 为 UTF-8</li></ul><p><img src="/c/assets/50.DHsnibMi.png" alt=""></p><ul><li>配置<code>控制台编码</code>为 UTF-8</li></ul><p><img src="/c/assets/51.BQr6Q0uV.png" alt=""></p><ul><li>配置<code>显示方法分隔符</code>功能:</li></ul><p><img src="/c/assets/52.BVemi2Lh.png" alt=""></p><ul><li>配置<code>编辑器</code>的字体(可选):</li></ul><p><img src="/c/assets/53.BHR69UXx.png" alt=""></p><ul><li>检测 GCC 工具链是否安装成功:</li></ul><p><img src="/c/assets/54.CPSU5SJI.png" alt=""></p><h3 id="_1-2-2-vs-code" tabindex="-1">1.2.2 VS Code <a class="header-anchor" href="#_1-2-2-vs-code" aria-label="Permalink to &quot;1.2.2 VS Code&quot;"></a></h3><h4 id="_1-2-2-1-概述" tabindex="-1">1.2.2.1 概述 <a class="header-anchor" href="#_1-2-2-1-概述" aria-label="Permalink to &quot;1.2.2.1 概述&quot;"></a></h4><ul><li><a href="https://code.visualstudio.com/" target="_blank" rel="noreferrer">Visual Studio Code (VS Code)</a> 是一个免费的开源代码编辑器,适用于 Windows、MacOS 和 Linux 平台。它支持语法高亮、智能代码补全IntelliSense、内置调试工具和Git集成。用户可以通过扩展来添加更多功能支持新的编程语言、主题和调试工具。VS Code 还支持在微软 Azure 上进行部署和托管,适用于各种编程语言和框架。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>Visual Studio Code 需要安装对应的插件,才能运行 C/C++ 代码。</p></div><h4 id="_1-2-2-2-安装" tabindex="-1">1.2.2.2 安装 <a class="header-anchor" href="#_1-2-2-2-安装" aria-label="Permalink to &quot;1.2.2.2 安装&quot;"></a></h4><ul><li>鼠标双击,进入安装:</li></ul><p><img src="/c/assets/55.CaQLoDlw.png" alt=""></p><ul><li>同意协议:</li></ul><p><img src="/c/assets/56.aRGy4XbL.png" alt=""></p><ul><li>下一步:</li></ul><p><img src="/c/assets/57.kNO9fmPR.png" alt=""></p><ul><li>下一步:</li></ul><p><img src="/c/assets/58.D4EkoC4o.png" alt=""></p><ul><li>下一步:</li></ul><p><img src="/c/assets/59.V23Lo9e_.png" alt=""></p><ul><li>安装:</li></ul><p><img src="/c/assets/60.Du9LVeMB.png" alt=""></p><ul><li>安装过程:</li></ul><p><img src="/c/assets/61.DdFg75U9.png" alt=""></p><ul><li>安装完成:</li></ul><p><img src="/c/assets/62.C6bz6KtT.png" alt=""></p><h4 id="_1-2-2-3-配置" tabindex="-1">1.2.2.3 配置 <a class="header-anchor" href="#_1-2-2-3-配置" aria-label="Permalink to &quot;1.2.2.3 配置&quot;"></a></h4><ul><li>安装<code>中文</code>插件:</li></ul><p><img src="/c/assets/63.CB6LAhB5.png" alt=""></p><p><img src="/c/assets/64.Bip8bkua.png" alt=""></p><ul><li>安装 <code>C/C++</code> 插件:</li></ul><p><img src="/c/assets/65.DRNHRduW.png" alt=""></p><p><img src="/c/assets/66.Cth4qqEn.png" alt=""></p><h3 id="_1-2-3-microsoft-visual-studio" tabindex="-1">1.2.3 Microsoft Visual Studio <a class="header-anchor" href="#_1-2-3-microsoft-visual-studio" aria-label="Permalink to &quot;1.2.3 Microsoft Visual Studio&quot;"></a></h3><h4 id="_1-2-3-1-概述" tabindex="-1">1.2.3.1 概述 <a class="header-anchor" href="#_1-2-3-1-概述" aria-label="Permalink to &quot;1.2.3.1 概述&quot;"></a></h4><ul><li><p><a href="https://visualstudio.microsoft.com/" target="_blank" rel="noreferrer">Visual Studio</a>(简称 VS是由微软公司发布的集成开发环境。它包括了整个软件生命周期中所需要的大部分工具UML工具、代码管控工具、集成开发环境IDE等。</p></li><li><p>Visual Studio 支持 C/C++、C#、F#、VB 等多种程序语言的开发和测试可以用于生成Web应用程序也可以生成桌面应用程序功能十分强大但下载和安装很可能耗时数小时还可能会塞满磁盘。</p></li><li><p>Visual Studio 2022 有三种版本:社区版(免费,不支持企业使用),专业版(第一年 1199 美元/ 799 美元续订)和企业版(第一年 5999 美元/ 2569 美元续订)。企业版拥有面向架构师的功能、高级调试和测试,这些功能是另两种 SKU 所没有的。</p></li><li><p>Visual Studio 旨在成为世界上最好的 IDE集成开发环境目前最新版本为 Visual Studio 2022。</p></li></ul><h4 id="_1-2-3-2-安装" tabindex="-1">1.2.3.2 安装 <a class="header-anchor" href="#_1-2-3-2-安装" aria-label="Permalink to &quot;1.2.3.2 安装&quot;"></a></h4><ul><li>鼠标双击,进入安装:</li></ul><p><img src="/c/assets/67.DWGWZ64P.png" alt=""></p><ul><li>继续:</li></ul><p><img src="/c/assets/68.3hDIDdvx.png" alt=""></p><ul><li>等待:</li></ul><p><img src="/c/assets/69.Bw_dQ4ap.png" alt=""></p><ul><li>工作负荷(使用 C++ 的桌面开发):</li></ul><p><img src="/c/assets/70.Cn_ubTyA.png" alt=""></p><ul><li>单个组件:</li></ul><p><img src="/c/assets/71.C84EBqwB.png" alt=""></p><ul><li>语言包:</li></ul><p><img src="/c/assets/72.dZfJY4eR.png" alt=""></p><ul><li>安装位置(修改默认的安装位置):</li></ul><p><img src="/c/assets/73.B0zm0Z79.png" alt=""></p><ul><li>如果不是第一次安装,可能会出现<code>共享组件、工具和 SDK</code>不可以修改,即:</li></ul><p><img src="/c/assets/74.CaTcEy1Q.png" alt=""></p><ul><li>此时,就需要打开<code>注册表编辑器</code>,将如下图中的除了第一个选项,全部删除,然后关闭再重新安装,即:</li></ul><p><img src="/c/assets/75.iEc8mo9g.png" alt=""></p><ul><li>开始安装:</li></ul><p><img src="/c/assets/76.Co2KxM6t.png" alt=""></p><ul><li>安装中:</li></ul><p><img src="/c/assets/77.CaUm8Qhc.png" alt=""></p><ul><li>安装完成,然后关闭:</li></ul><p><img src="/c/assets/78.kOkqIKG6.png" alt=""></p><h4 id="_1-2-3-3-配置" tabindex="-1">1.2.3.3 配置 <a class="header-anchor" href="#_1-2-3-3-配置" aria-label="Permalink to &quot;1.2.3.3 配置&quot;"></a></h4><ul><li>在开始菜单处,启动 VS </li></ul><p><img src="/c/assets/79.CyeASH-c.png" alt=""></p><ul><li>登录或跳过该选项(有微软账号就注册,没有就暂时跳过):</li></ul><p><img src="/c/assets/80.CFdk60La.png" alt=""></p><ul><li>继续:</li></ul><p><img src="/c/assets/81.Bhl-0uK_.png" alt=""></p><ul><li>注册 VS </li></ul><p><img src="/c/assets/82.Dni9KbXV.png" alt=""></p><ul><li>填写注册码:</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① Pro 版本:<code>TD244-P4NB7-YQ6XK-Y8MMM-YWV2J</code></li><li>② Enterprise 版本:<code>VHF9H-NXBBB-638P6-6JHCY-88JWH</code></li></ul></div><p><img src="/c/assets/83.BXx10MCV.png" alt=""></p><p><img src="/c/assets/84.CXcIKX1T.png" alt=""></p><h1 id="第二章-c-语言入门-helloworld-⭐" tabindex="-1">第二章C 语言入门HelloWorld <a class="header-anchor" href="#第二章-c-语言入门-helloworld-⭐" aria-label="Permalink to &quot;第二章C 语言入门HelloWorld&quot;"></a></h1><h2 id="_2-1-手动版" tabindex="-1">2.1 手动版 <a class="header-anchor" href="#_2-1-手动版" aria-label="Permalink to &quot;2.1 手动版&quot;"></a></h2><ul><li>① 新建一个 <code>HelloWorld.c</code> 的文件:</li></ul><p><img src="/c/assets/85.CQ3_QCQT.png" alt=""></p><ul><li>② 通过<code>记事本</code>等软件打开该文件,输入如下的代码,并保存:</li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span></span>
<div id="app"><div class="Layout" data-v-5d98c3a5><!--[--><!--]--><!--[--><span tabindex="-1" data-v-0f60ec36></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-0f60ec36> Skip to content </a><!--]--><!----><header class="VPNav" data-v-5d98c3a5 data-v-ae24b3ad><div class="VPNavBar has-sidebar top" data-v-ae24b3ad data-v-6aa21345><div class="wrapper" data-v-6aa21345><div class="container" data-v-6aa21345><div class="title" data-v-6aa21345><div class="VPNavBarTitle has-sidebar" data-v-6aa21345 data-v-ab179fa1><a class="title" href="/c/" data-v-ab179fa1><!--[--><!--]--><!--[--><img class="VPImage logo" src="/c/logo.svg" alt data-v-8426fc1a><!--]--><span data-v-ab179fa1>许大仙</span><!--[--><!--]--></a></div></div><div class="content" data-v-6aa21345><div class="content-body" data-v-6aa21345><!--[--><!--]--><div class="VPNavBarSearch search" data-v-6aa21345><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><span class="vp-icon DocSearch-Search-Icon"></span><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-6aa21345 data-v-dc692963><span id="main-nav-aria-label" class="visually-hidden" data-v-dc692963> Main Navigation </span><!--[--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/" target="_blank" rel="noreferrer" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>首页</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/coa6/notes/" target="_blank" rel="noreferrer" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>计组6件套</span><!--]--></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-dc692963 data-v-b6c34ac9><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-b6c34ac9><span class="text" data-v-b6c34ac9><!----><span data-v-b6c34ac9>编程语言</span><span class="vpi-chevron-down text-icon" data-v-b6c34ac9></span></span></button><div class="menu" data-v-b6c34ac9><div class="VPMenu" data-v-b6c34ac9 data-v-b98bc113><div class="items" data-v-b98bc113><!--[--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link" href="/c/notes/" data-v-43f1e123><!--[-->c/c++<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/web-design/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->前端<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/java/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->Java<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/big-data/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->大数据<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/linux/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->云原生<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/go/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->Go<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/python/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->Python<!--]--></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/open-software/notes/" target="_blank" rel="noreferrer" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>开源软件</span><!--]--></a><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-6aa21345 data-v-6c893767><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-6c893767 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-6aa21345 data-v-0394ad82 data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/Aurorxa" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-eee4e7cb><span class="vpi-social-github" /></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-6aa21345 data-v-bb2aa2f0 data-v-b6c34ac9><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-b6c34ac9><span class="vpi-more-horizontal icon" data-v-b6c34ac9></span></button><div class="menu" data-v-b6c34ac9><div class="VPMenu" data-v-b6c34ac9 data-v-b98bc113><!----><!--[--><!--[--><!----><div class="group" data-v-bb2aa2f0><div class="item appearance" data-v-bb2aa2f0><p class="label" data-v-bb2aa2f0>Appearance</p><div class="appearance-action" data-v-bb2aa2f0><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-bb2aa2f0 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div></div></div><div class="group" data-v-bb2aa2f0><div class="item social-links" data-v-bb2aa2f0><div class="VPSocialLinks social-links-list" data-v-bb2aa2f0 data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/Aurorxa" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-eee4e7cb><span class="vpi-social-github" /></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-6aa21345 data-v-e5dd9c1c><span class="container" data-v-e5dd9c1c><span class="top" data-v-e5dd9c1c></span><span class="middle" data-v-e5dd9c1c></span><span class="bottom" data-v-e5dd9c1c></span></span></button></div></div></div></div><div class="divider" data-v-6aa21345><div class="divider-line" data-v-6aa21345></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-5d98c3a5 data-v-a6f0e41e><div class="container" data-v-a6f0e41e><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-a6f0e41e><span class="vpi-align-left menu-icon" data-v-a6f0e41e></span><span class="menu-text" data-v-a6f0e41e>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-a6f0e41e data-v-17a5e62e><button data-v-17a5e62e>返回顶部</button><!----></div></div></div><aside class="VPSidebar" data-v-5d98c3a5 data-v-319d5ca6><div class="curtain" data-v-319d5ca6></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-319d5ca6><span class="visually-hidden" id="sidebar-aria-label" data-v-319d5ca6> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible has-active" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h2 class="text" data-v-b7550ba0>C 语言基础</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/00_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>编程基础</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>C 语言入门</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/02_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>变量和进制</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/03_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>数据类型和运算符</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/04_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>流程控制</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/05_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>数组</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/06_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>指针</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/07_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>函数</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/08_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>预处理器</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/09_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>自定义数据类型</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/10_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>字符串和时间</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/11_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>内存管理</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/12_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>文件操作</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/13_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>调试工具和调试技巧gdb和make</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/14_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>常用库函数</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h2 class="text" data-v-b7550ba0>C 语言高级</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>变量和内存分布</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/02_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>指针强化</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/03_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>结构体和文件的高级用法</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/04_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>链表和回调函数</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/05_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>编译过程和面向接口</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h2 class="text" data-v-b7550ba0>项目构建工具</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><section class="VPSidebarItem level-1 collapsible collapsed" data-v-b7550ba0 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h3 class="text" data-v-b7550ba0>meson</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-2 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/03_build/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Gradle 入门</p><!--]--></a><!----></div><!----></div><!--]--></div></section><section class="VPSidebarItem level-1 collapsible collapsed" data-v-b7550ba0 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h3 class="text" data-v-b7550ba0>cmake</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-2 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/03_build/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Gradle 入门</p><!--]--></a><!----></div><!----></div><!--]--></div></section><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/03_build/01_${commonDirectoryName}/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>conan </p><!--]--></a><!----></div><!----></div><section class="VPSidebarItem level-1 collapsible collapsed" data-v-b7550ba0 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h3 class="text" data-v-b7550ba0>Gradle</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-2 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/03_build/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Gradle 入门</p><!--]--></a><!----></div><!----></div><!--]--></div></section><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h2 class="text" data-v-b7550ba0>Linux</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/04_linux/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Linux 初识和安装</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><div class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><p class="text" data-v-b7550ba0>C++ 核心编程</p><!----></div><!----></div></div><div class="no-transition group" data-v-c40bc020><div class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><p class="text" data-v-b7550ba0>C++ 标准库</p><!----></div><!----></div></div><div class="no-transition group" data-v-c40bc020><div class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><p class="text" data-v-b7550ba0>QT 桌面开发</p><!----></div><!----></div></div><div class="no-transition group" data-v-c40bc020><div class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><p class="text" data-v-b7550ba0>Linux 高并发服务器开发</p><!----></div><!----></div></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-5d98c3a5 data-v-1428d186><div class="VPDoc has-sidebar has-aside" data-v-1428d186 data-v-39a288b8><!--[--><!--]--><div class="container" data-v-39a288b8><div class="aside" data-v-39a288b8><div class="aside-curtain" data-v-39a288b8></div><div class="aside-container" data-v-39a288b8><div class="aside-content" data-v-39a288b8><div class="VPDocAside" data-v-39a288b8 data-v-3f215769><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-3f215769 data-v-a5bbad30><div class="content" data-v-a5bbad30><div class="outline-marker" data-v-a5bbad30></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-a5bbad30>目录</div><ul class="VPDocOutlineItem root" data-v-a5bbad30 data-v-b933a997><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-3f215769></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-39a288b8><div class="content-container" data-v-39a288b8><!--[--><!--]--><main class="main" data-v-39a288b8><div style="position:relative;" class="vp-doc _c_notes_01_c-basic_01_xdx_" data-v-39a288b8><div><h1 id="第一章-开发环境的安装和配置-⭐" tabindex="-1">第一章:开发环境的安装和配置(⭐) <a class="header-anchor" href="#第一章-开发环境的安装和配置-⭐" aria-label="Permalink to &quot;第一章:开发环境的安装和配置(⭐)&quot;"></a></h1><h2 id="_1-1-编译器的安装和配置" tabindex="-1">1.1 编译器的安装和配置 <a class="header-anchor" href="#_1-1-编译器的安装和配置" aria-label="Permalink to &quot;1.1 编译器的安装和配置&quot;"></a></h2><h3 id="_1-1-1-概述" tabindex="-1">1.1.1 概述 <a class="header-anchor" href="#_1-1-1-概述" aria-label="Permalink to &quot;1.1.1 概述&quot;"></a></h3><ul><li>要开发 C/C++ 程序,需要安装 C/C++ 编译器,目前有两种主流实现,即: <ul><li>GCCGNU Compiler Collection全平台实现即支持 Windows、MacOS、Linux 等。</li><li>MSVCMicrosoft Visual C++):只支持 Windows 系统。</li></ul></li><li>GCC 在 Windows 上的版本有很多,如:<a href="https://www.mingw-w64.org/" target="_blank" rel="noreferrer">MinGW-w64</a><a href="https://cygwin.com/" target="_blank" rel="noreferrer">Gygwin</a><a href="https://www.msys2.org/" target="_blank" rel="noreferrer">MSYS2</a>。它们之间的区别,如下所示:</li></ul><table tabindex="0"><thead><tr><th>特性</th><th>MinGW-w64</th><th>Cygwin</th><th>MSYS2</th></tr></thead><tbody><tr><td><strong>简介</strong></td><td>Minimalist GNU for Windows</td><td>POSIX 兼容环境和工具集</td><td>结合了 MinGW 和 Cygwin 的工具集</td></tr><tr><td><strong>编译器</strong></td><td>提供 GCC 编译器</td><td>提供 POSIX 兼容环境,包含大量工具</td><td>提供 MinGW-w64 工具链和 Cygwin 环境</td></tr><tr><td><strong>生成文件</strong></td><td>Windows 原生可执行文件</td><td>POSIX 兼容的可执行文件</td><td>可以生成 Windows 原生可执行文件或 POSIX 文件</td></tr><tr><td><strong>依赖</strong></td><td>无需额外依赖</td><td>依赖 Cygwin DLL</td><td>根据使用工具链决定MinGW-w64 无依赖Cygwin 有依赖)</td></tr><tr><td><strong>工具和库</strong></td><td>基本的编译工具</td><td>丰富的 Unix 工具和库</td><td>丰富的工具和库,强大的包管理系统</td></tr><tr><td><strong>性能</strong></td><td>性能较好</td><td>可能较低,因为通过兼容层调用系统</td><td>取决于使用的工具链MinGW-w64 性能较好)</td></tr><tr><td><strong>复杂度</strong></td><td>简单易用</td><td>设置和使用相对复杂</td><td>较为灵活,复杂度介于 MinGW-w64 和 Cygwin 之间</td></tr><tr><td><strong>适用场景</strong></td><td>开发 Windows 原生应用</td><td>运行和开发 Unix 程序</td><td>混合使用 Unix 工具和开发 Windows 原生应用</td></tr><tr><td><strong>优点</strong></td><td>轻量级,直接生成 Windows 应用</td><td>完整的 POSIX 兼容环境,丰富的工具</td><td>灵活的环境,强大的包管理系统</td></tr><tr><td><strong>缺点</strong></td><td>工具和库较少</td><td>生成文件依赖 Cygwin DLL性能可能较低</td><td>环境较大,占用更多空间,复杂性比 MinGW-w64 高</td></tr></tbody></table><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① MinGW-w64 、Cygwin 以及 MSYS2 任选其一安装即可。</li><li>② 目前的 Win10 和 Win11 版本支持 WSL2 Windows Sub Linux 2 ,即 Windows 的子系统 Linux可以实现在 Windows 系统上安装一个 Linux ,然后再运行 Linux 中的 GCC 工具链。</li><li>③ 本人的操作系统是 Win11 ,安装和配置都将以该系统为基础作为演示,后续不再赘述!!!</li></ul></div><h3 id="_1-1-2-mingw-w64-的安装和配置" tabindex="-1">1.1.2 MinGW-w64 的安装和配置 <a class="header-anchor" href="#_1-1-2-mingw-w64-的安装和配置" aria-label="Permalink to &quot;1.1.2 MinGW-w64 的安装和配置&quot;"></a></h3><h4 id="_1-1-2-1-安装" tabindex="-1">1.1.2.1 安装 <a class="header-anchor" href="#_1-1-2-1-安装" aria-label="Permalink to &quot;1.1.2.1 安装&quot;"></a></h4><ul><li>下载到本地:略。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>下载地址在<a href="https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-posix-seh-ucrt-rt_v11-rev1.7z" target="_blank" rel="noreferrer">这里</a></p></div><p><img src="/c/assets/1.D60Zf6_d.png" alt=""></p><ul><li>解压到指定的目录,即:</li></ul><p><img src="/c/assets/2.D2-G6nV2.png" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>本人的解压目录是:<code>D:\develop\mingw64</code></p></div><h4 id="_1-1-2-2-配置-path-环境变量" tabindex="-1">1.1.2.2 配置 path 环境变量 <a class="header-anchor" href="#_1-1-2-2-配置-path-环境变量" aria-label="Permalink to &quot;1.1.2.2 配置 path 环境变量&quot;"></a></h4><ul><li>配置环境变量,以便任意目录都可以执行 gcc 命令,即:</li></ul><p><img src="/c/assets/3.DpzkVk5V.png" alt=""></p><p><img src="/c/assets/4.BXk95GIP.png" alt=""></p><p><img src="/c/assets/5.CbWTB08W.png" alt=""></p><p><img src="/c/assets/6.twO9TCIg.png" alt=""></p><p><img src="/c/assets/7.CKOjeIvS.png" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>因为,本人安装 MinGW-w64 的目录是 <code>D:\develop\mingw64</code>,所以配置 path 环境变量就需要 <code>D:\develop\mingw64\bin</code></p></div><p><img src="/c/assets/8.DKmR0CxE.png" alt=""></p><ul><li>测试是否安装成功:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --version</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/9.Cudf77_s.gif" alt=""></p><h3 id="_1-1-3-cygwin-的安装和配置" tabindex="-1">1.1.3 Cygwin 的安装和配置 <a class="header-anchor" href="#_1-1-3-cygwin-的安装和配置" aria-label="Permalink to &quot;1.1.3 Cygwin 的安装和配置&quot;"></a></h3><h4 id="_1-1-3-1-安装" tabindex="-1">1.1.3.1 安装 <a class="header-anchor" href="#_1-1-3-1-安装" aria-label="Permalink to &quot;1.1.3.1 安装&quot;"></a></h4><ul><li>下载到本地:略。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>下载地址在<a href="https://www.cygwin.com/install.html" target="_blank" rel="noreferrer">这里</a></p></div><p><img src="/c/assets/10.BBUUlhRC.png" alt=""></p><ul><li>点击安装:</li></ul><p><img src="/c/assets/11.iLABkB7O.png" alt=""></p><p><img src="/c/assets/12.BQuYWOU9.png" alt=""></p><p><img src="/c/assets/13.CslpH6j0.png" alt=""></p><p><img src="/c/assets/14.BAyvZdKq.png" alt=""></p><p><img src="/c/assets/15.C3oC1iUd.png" alt=""></p><p><img src="/c/assets/16.Ds-jsEZn.png" alt=""></p><p><img src="/c/assets/17.Cd37gMYs.png" alt=""></p><p><img src="/c/assets/18.CAw2z3gc.png" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>默认是最小化安装,没有 GCC需要选择 gcc-core、gcc-g++、make、gdb、binutils 。</p></div><p><img src="/c/assets/19.DdPThnr-.png" alt=""></p><p><img src="/c/assets/20.q_rvlDnY.png" alt=""></p><p><img src="/c/assets/21.JRHg9RZA.png" alt=""></p><p><img src="/c/assets/22.Baq-Hb06.png" alt=""></p><p><img src="/c/assets/23.c1ht53mu.png" alt=""></p><p><img src="/c/assets/24.CAZmH5Py.png" alt=""></p><p><img src="/c/assets/25.DWeCYBe9.png" alt=""></p><p><img src="/c/assets/26.2XM8pYni.png" alt=""></p><p><img src="/c/assets/27.CN0t-fuo.png" alt=""></p><h4 id="_1-1-3-2-配置-path-环境变量" tabindex="-1">1.1.3.2 配置 path 环境变量 <a class="header-anchor" href="#_1-1-3-2-配置-path-环境变量" aria-label="Permalink to &quot;1.1.3.2 配置 path 环境变量&quot;"></a></h4><ul><li><code>3.1.2.2 配置 path 环境变量</code> 步骤相同:略。</li></ul><h3 id="_1-1-4-msys2-推荐" tabindex="-1">1.1.4 MSYS2推荐 <a class="header-anchor" href="#_1-1-4-msys2-推荐" aria-label="Permalink to &quot;1.1.4 MSYS2推荐&quot;"></a></h3><h4 id="_1-1-4-1-安装" tabindex="-1">1.1.4.1 安装 <a class="header-anchor" href="#_1-1-4-1-安装" aria-label="Permalink to &quot;1.1.4.1 安装&quot;"></a></h4><ul><li>下载到本地:略。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>下载地址在<a href="https://www.msys2.org/" target="_blank" rel="noreferrer">这里</a></p></div><p><img src="/c/assets/28.AcDh3LXQ.png" alt=""></p><ul><li>点击安装:</li></ul><p><img src="/c/assets/29.CUkDFAc6.png" alt=""></p><p><img src="/c/assets/30.picNTNaJ.png" alt=""></p><p><img src="/c/assets/31.DKX92RgJ.png" alt=""></p><p><img src="/c/assets/32.Bxr7QKI3.png" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>可能很多人,会遇到安装到 <code>50%</code> 就一直卡死在那边,不用慌,关闭它,再次重新安装即可。</p></div><p><img src="/c/assets/33.DuFWsOgW.png" alt=""></p><ul><li>出现命令终端:</li></ul><p><img src="/c/assets/34.Da9qUcfr.png" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>如果没有出现命令终端,也不要慌,去 Win11 操作系统的<code>开始</code>菜单,那边找一下,就能找到。</p></div><ul><li>替换清华镜像源(可选):</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sed</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -i</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;s#https\?://mirror.msys2.org/#https://mirrors.tuna.tsinghua.edu.cn/msys2/#g&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /etc/pacman.d/mirrorlist</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">*</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><p><img src="/c/assets/35.7_gEABSX.gif" alt=""></p><ul><li>安装 gcc 等相关开发包:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pacman</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -Syu</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --noconfirm</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # 更新包管理器</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pacman</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -Sy</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> base-devel</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --noconfirm</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # 安装开发工具包</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pacman</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -Sy</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> mingw-w64-x86_64-toolchain</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --noconfirm</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # 安装开发 gcc 相关工具链</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/36.C2KQYoVC.gif" alt=""></p><h4 id="_1-1-4-2-配置-path-环境变量" tabindex="-1">1.1.4.2 配置 path 环境变量 <a class="header-anchor" href="#_1-1-4-2-配置-path-环境变量" aria-label="Permalink to &quot;1.1.4.2 配置 path 环境变量&quot;"></a></h4><ul><li><code>3.1.2.2 配置 path 环境变量</code> 步骤相同:略。</li></ul><h2 id="_1-2-什么是-ide-集成开发环境" tabindex="-1">1.2 什么是 IDE集成开发环境 <a class="header-anchor" href="#_1-2-什么是-ide-集成开发环境" aria-label="Permalink to &quot;1.2 什么是 IDE集成开发环境&quot;"></a></h2><ul><li><p>在实际开发中,除了<code>编译器</code>是必须安装的工具之外,我们往往还需要其他的辅助软件,如下所示:</p><ul><li>编辑器:用来编写代码,并且给代码着色,以方便阅读。</li><li>代码提示器:输入部分代码,即可提示全部代码,加速代码的编写过程。</li><li>调试器:观察程序的每一个运行步骤,发现程序的逻辑错误。</li><li>项目管理工具:对程序涉及到的所有资源进行管理,包括:源文件、图片、视频、第三方库等。</li><li>漂亮的界面:各种按钮、面板、菜单、窗口等控件整齐排布,操作更方便。</li></ul></li><li><p>这些工具通常被打包在一起统一安装和发布Visual Studio、CLion 以及 VS Code 通常为集成开发环境IDEIntegrated Development Environment</p></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① IDE集成开发环境就是一系列开发工具的组合套装。</li><li>② IDE 开箱即用,即安装完毕之后,稍微配置一下就可以使用,不需要手动编译一个个的源文件,只需要点几下界面上的按钮就可以了。</li><li>③ 严格来讲, VS Code 属于编辑器,而不是 IDE但是可以通过安装插件来完成 IDE 的功能;而 Visual Studio 和CLion 属于 IDE。</li><li>④ 在实际开发中,使用 IDE 并不是一种丢人的事情。一些有人在网上吹:“学习编程,刚开始需要使用<code>记事本</code><code>vi</code>等简单的编辑器软件,不要使用 IDE ”,目的可能是为了让初学者熟悉基础的编程概念和语法,并避免依赖 IDE 的辅助功能。但是,这种方法或许可以起到锻炼基础技能的功能,但这并不意味着 IDE 就不适合初学者。事实上,许多 IDE 还提供了初学者友好的界面和工具,可以帮助新手更快地入门和理解编程。</li></ul></div><h2 id="_1-3-ide-的安装和配置" tabindex="-1">1.3 IDE 的安装和配置 <a class="header-anchor" href="#_1-3-ide-的安装和配置" aria-label="Permalink to &quot;1.3 IDE 的安装和配置&quot;"></a></h2><h3 id="_1-3-1-clion" tabindex="-1">1.3.1 CLion <a class="header-anchor" href="#_1-3-1-clion" aria-label="Permalink to &quot;1.3.1 CLion&quot;"></a></h3><h4 id="_1-3-1-1-概述" tabindex="-1">1.3.1.1 概述 <a class="header-anchor" href="#_1-3-1-1-概述" aria-label="Permalink to &quot;1.3.1.1 概述&quot;"></a></h4><ul><li><a href="https://www.jetbrains.com/clion/" target="_blank" rel="noreferrer">CLion</a> 是一款由 JetBrains 推出的跨平台 C/C++ 集成开发环境IDE它具有智能编辑器、CMake 构建支持、调试器、单元测试、代码分析等功能,可以极大提高 C/C++ 开发效率。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>本次,演示的 CLion 的安装版本是 2024.1.4 ,后续版本可能会更新,但是操作几乎不会发生太多变化!!!</p></div><h4 id="_1-3-1-2-安装" tabindex="-1">1.3.1.2 安装 <a class="header-anchor" href="#_1-3-1-2-安装" aria-label="Permalink to &quot;1.3.1.2 安装&quot;"></a></h4><ul><li>鼠标双击,进入安装:</li></ul><p><img src="/c/assets/37.RTUP8Vtx.png" alt=""></p><ul><li>下一步:</li></ul><p><img src="/c/assets/38.Dq21DxwL.png" alt=""></p><ul><li>下一步:</li></ul><p><img src="/c/assets/39.QmpUaNxU.png" alt=""></p><ul><li>下一步:</li></ul><p><img src="/c/assets/40.DP0C29gZ.png" alt=""></p><ul><li>安装:</li></ul><p><img src="/c/assets/41.DwzHokd4.png" alt=""></p><ul><li>安装完成:</li></ul><p><img src="/c/assets/42.Bi6K26yA.png" alt=""></p><h4 id="_1-3-1-3-配置" tabindex="-1">1.3.1.3 配置 <a class="header-anchor" href="#_1-3-1-3-配置" aria-label="Permalink to &quot;1.3.1.3 配置&quot;"></a></h4><ul><li>打开 CLion </li></ul><p><img src="/c/assets/43.Bw8DcEQ_.png" alt=""></p><ul><li>安装中文插件(可选):</li></ul><p><img src="/c/assets/44.DPc8Z9rS.png" alt=""></p><p><img src="/c/assets/45.S84xHMTl.png" alt=""></p><ul><li>配置新 UI </li></ul><p><img src="/c/assets/46.iw3JQUkn.png" alt=""></p><p><img src="/c/assets/47.ILeJt-HK.png" alt=""></p><ul><li>新 UI 配置自定义字体(可选):</li></ul><p><img src="/c/assets/48.CHgm7khh.png" alt=""></p><ul><li>配置<code>自动保存</code>功能:</li></ul><p><img src="/c/assets/49.N1nqJaEg.png" alt=""></p><ul><li>配置<code>文件编码</code> 为 UTF-8</li></ul><p><img src="/c/assets/50.DHsnibMi.png" alt=""></p><ul><li>配置<code>控制台编码</code>为 UTF-8</li></ul><p><img src="/c/assets/51.BQr6Q0uV.png" alt=""></p><ul><li>配置<code>显示方法分隔符</code>功能:</li></ul><p><img src="/c/assets/52.BVemi2Lh.png" alt=""></p><ul><li>配置<code>编辑器</code>的字体(可选):</li></ul><p><img src="/c/assets/53.BHR69UXx.png" alt=""></p><ul><li>检测 GCC 工具链是否安装成功:</li></ul><p><img src="/c/assets/54.CPSU5SJI.png" alt=""></p><h3 id="_1-3-2-vs-code" tabindex="-1">1.3.2 VS Code <a class="header-anchor" href="#_1-3-2-vs-code" aria-label="Permalink to &quot;1.3.2 VS Code&quot;"></a></h3><h4 id="_1-3-2-1-概述" tabindex="-1">1.3.2.1 概述 <a class="header-anchor" href="#_1-3-2-1-概述" aria-label="Permalink to &quot;1.3.2.1 概述&quot;"></a></h4><ul><li><a href="https://code.visualstudio.com/" target="_blank" rel="noreferrer">Visual Studio Code (VS Code)</a> 是一个免费的开源代码编辑器,适用于 Windows、MacOS 和 Linux 平台。它支持语法高亮、智能代码补全IntelliSense、内置调试工具和Git集成。用户可以通过扩展来添加更多功能支持新的编程语言、主题和调试工具。VS Code 还支持在微软 Azure 上进行部署和托管,适用于各种编程语言和框架。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>Visual Studio Code 需要安装对应的插件,才能运行 C/C++ 代码。</p></div><h4 id="_1-3-2-2-安装" tabindex="-1">1.3.2.2 安装 <a class="header-anchor" href="#_1-3-2-2-安装" aria-label="Permalink to &quot;1.3.2.2 安装&quot;"></a></h4><ul><li>鼠标双击,进入安装:</li></ul><p><img src="/c/assets/55.CaQLoDlw.png" alt=""></p><ul><li>同意协议:</li></ul><p><img src="/c/assets/56.aRGy4XbL.png" alt=""></p><ul><li>下一步:</li></ul><p><img src="/c/assets/57.kNO9fmPR.png" alt=""></p><ul><li>下一步:</li></ul><p><img src="/c/assets/58.D4EkoC4o.png" alt=""></p><ul><li>下一步:</li></ul><p><img src="/c/assets/59.V23Lo9e_.png" alt=""></p><ul><li>安装:</li></ul><p><img src="/c/assets/60.Du9LVeMB.png" alt=""></p><ul><li>安装过程:</li></ul><p><img src="/c/assets/61.DdFg75U9.png" alt=""></p><ul><li>安装完成:</li></ul><p><img src="/c/assets/62.C6bz6KtT.png" alt=""></p><h4 id="_1-3-2-3-配置" tabindex="-1">1.3.2.3 配置 <a class="header-anchor" href="#_1-3-2-3-配置" aria-label="Permalink to &quot;1.3.2.3 配置&quot;"></a></h4><ul><li>安装<code>中文</code>插件:</li></ul><p><img src="/c/assets/63.CB6LAhB5.png" alt=""></p><p><img src="/c/assets/64.Bip8bkua.png" alt=""></p><ul><li>安装 <code>C/C++</code> 插件:</li></ul><p><img src="/c/assets/65.DRNHRduW.png" alt=""></p><p><img src="/c/assets/66.Cth4qqEn.png" alt=""></p><h3 id="_1-3-3-microsoft-visual-studio" tabindex="-1">1.3.3 Microsoft Visual Studio <a class="header-anchor" href="#_1-3-3-microsoft-visual-studio" aria-label="Permalink to &quot;1.3.3 Microsoft Visual Studio&quot;"></a></h3><h4 id="_1-3-3-1-概述" tabindex="-1">1.3.3.1 概述 <a class="header-anchor" href="#_1-3-3-1-概述" aria-label="Permalink to &quot;1.3.3.1 概述&quot;"></a></h4><ul><li><a href="https://visualstudio.microsoft.com/" target="_blank" rel="noreferrer">Visual Studio</a>(简称 VS是由微软公司发布的集成开发环境。它包括了整个软件生命周期中所需要的大部分工具UML工具、代码管控工具、集成开发环境IDE等。</li><li>Visual Studio 支持 C/C++、C#、F#、VB 等多种程序语言的开发和测试可以用于生成Web应用程序也可以生成桌面应用程序功能十分强大但下载和安装很可能耗时数小时还可能会塞满磁盘。</li><li>Visual Studio 2022 有三种版本:社区版(免费,不支持企业使用),专业版(第一年 1199 美元/ 799 美元续订)和企业版(第一年 5999 美元/ 2569 美元续订)。企业版拥有面向架构师的功能、高级调试和测试,这些功能是另两种 SKU 所没有的。</li><li>Visual Studio 旨在成为世界上最好的 IDE集成开发环境目前最新版本为 Visual Studio 2022。</li></ul><h4 id="_1-3-3-2-安装" tabindex="-1">1.3.3.2 安装 <a class="header-anchor" href="#_1-3-3-2-安装" aria-label="Permalink to &quot;1.3.3.2 安装&quot;"></a></h4><ul><li>鼠标双击,进入安装:</li></ul><p><img src="/c/assets/67.DWGWZ64P.png" alt=""></p><ul><li>继续:</li></ul><p><img src="/c/assets/68.3hDIDdvx.png" alt=""></p><ul><li>等待:</li></ul><p><img src="/c/assets/69.Bw_dQ4ap.png" alt=""></p><ul><li>工作负荷(使用 C++ 的桌面开发):</li></ul><p><img src="/c/assets/70.Cn_ubTyA.png" alt=""></p><ul><li>单个组件:</li></ul><p><img src="/c/assets/71.C84EBqwB.png" alt=""></p><ul><li>语言包:</li></ul><p><img src="/c/assets/72.dZfJY4eR.png" alt=""></p><ul><li>安装位置(修改默认的安装位置):</li></ul><p><img src="/c/assets/73.B0zm0Z79.png" alt=""></p><ul><li>如果不是第一次安装,可能会出现<code>共享组件、工具和 SDK</code>不可以修改,即:</li></ul><p><img src="/c/assets/74.CaTcEy1Q.png" alt=""></p><ul><li>此时,就需要打开<code>注册表编辑器</code>,将如下图中的除了第一个选项,全部删除,然后关闭再重新安装,即:</li></ul><p><img src="/c/assets/75.iEc8mo9g.png" alt=""></p><ul><li>开始安装:</li></ul><p><img src="/c/assets/76.Co2KxM6t.png" alt=""></p><ul><li>安装中:</li></ul><p><img src="/c/assets/77.CaUm8Qhc.png" alt=""></p><ul><li>安装完成,然后关闭:</li></ul><p><img src="/c/assets/78.kOkqIKG6.png" alt=""></p><h4 id="_1-3-3-3-配置" tabindex="-1">1.3.3.3 配置 <a class="header-anchor" href="#_1-3-3-3-配置" aria-label="Permalink to &quot;1.3.3.3 配置&quot;"></a></h4><ul><li>在开始菜单处,启动 VS </li></ul><p><img src="/c/assets/79.CyeASH-c.png" alt=""></p><ul><li>登录或跳过该选项(有微软账号就注册,没有就暂时跳过):</li></ul><p><img src="/c/assets/80.CFdk60La.png" alt=""></p><ul><li>继续:</li></ul><p><img src="/c/assets/81.Bhl-0uK_.png" alt=""></p><ul><li>注册 VS </li></ul><p><img src="/c/assets/82.Dni9KbXV.png" alt=""></p><ul><li>填写注册码:</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① Pro 版本:<code>TD244-P4NB7-YQ6XK-Y8MMM-YWV2J</code></li><li>② Enterprise 版本:<code>VHF9H-NXBBB-638P6-6JHCY-88JWH</code></li></ul></div><p><img src="/c/assets/83.BXx10MCV.png" alt=""></p><p><img src="/c/assets/84.CXcIKX1T.png" alt=""></p><h1 id="第二章-c-语言入门-helloworld-⭐" tabindex="-1">第二章C 语言入门HelloWorld <a class="header-anchor" href="#第二章-c-语言入门-helloworld-⭐" aria-label="Permalink to &quot;第二章C 语言入门HelloWorld&quot;"></a></h1><h2 id="_2-1-手动版" tabindex="-1">2.1 手动版 <a class="header-anchor" href="#_2-1-手动版" aria-label="Permalink to &quot;2.1 手动版&quot;"></a></h2><ul><li>① 新建一个 <code>HelloWorld.c</code> 的文件:</li></ul><p><img src="/c/assets/85.CQ3_QCQT.png" alt=""></p><ul><li>② 通过<code>记事本</code>等软件打开该文件,输入如下的代码,并保存:</li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(){</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Hello World&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
@ -41,7 +43,7 @@
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Hello World&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><p><img src="/c/assets/110.C8QUZ9v3.gif" alt=""></p><ul><li>③ 编译和运行:</li></ul><p><img src="/c/assets/111.g5tQfhWz.gif" alt=""></p><ul><li>④ 默认情况下,一个项目只能有一个 c 源文件包含 main 函数,但是 CLion 可以有多个,如下:</li></ul><p><img src="/c/assets/112.CX0_1NsE.gif" alt=""></p><ul><li>⑤ 如果之后,有中文乱码问题,那么请做如下步骤:</li></ul><p><img src="/c/assets/113.BrFJeoK6.png" alt=""></p><p><img src="/c/assets/114.58TjSSjH.gif" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>内容如下所示:</p><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>-Dfile.encoding=UTF-8</span></span>
<span class="line"><span>-Dconsole.encoding=UTF-8</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div></div><h1 id="第三章-五花八门的-c-语言编译器-⭐" tabindex="-1">第三章:五花八门的 C 语言编译器(⭐) <a class="header-anchor" href="#第三章-五花八门的-c-语言编译器-⭐" aria-label="Permalink to &quot;第三章:五花八门的 C 语言编译器(⭐)&quot;"></a></h1><h2 id="_3-1-概述" tabindex="-1">3.1 概述 <a class="header-anchor" href="#_3-1-概述" aria-label="Permalink to &quot;3.1 概述&quot;"></a></h2><ul><li>由于 C 语言的历史比较久,而且早期没有规范,整个计算机产业也都处于拓荒的年代,所以就涌现了很多款 C 语言编译器,它们各有特点,适用于不同的平台。</li></ul><h2 id="_3-2-桌面操作系统" tabindex="-1">3.2 桌面操作系统 <a class="header-anchor" href="#_3-2-桌面操作系统" aria-label="Permalink to &quot;3.2 桌面操作系统&quot;"></a></h2><ul><li>目前而言,主流的桌面操作系统就是 Windows、Linux 和 MacOS 。</li><li>对于 Windows 而言,使用的最多的 C/C++ 编译器是 <code>MSVC</code> Microsoft Visual C++),被集成在 Visual Studio 开发环境中,其特点如下: <ul><li><strong>兼容性</strong>: 与 Windows 操作系统和 Windows API 深度集成,生成的二进制文件为 PE 格式。</li><li><strong>调试工具</strong>: 提供强大的调试工具Visual Studio Debugger。</li><li><strong>优化</strong>: 支持各种编译器优化,特别是针对 Windows 平台的优化。</li><li><strong>库支持</strong>: 提供丰富的 Windows 专用库,如:<s>MFCMicrosoft Foundation Class Library</s></li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>MSVC 不开源,我们可以使用 Visual Studio Community 社区版,但是如果想使用 Visual Studio Community 社区版生成出来的应用进行商用,就需要好好阅读微软的许可证和说明书了。</p></div><ul><li>对于 Linux 而言,使用的最多的 C/C++ 编译器是 <code>GCC</code>(支持多种架构和语言),并且很多 Linux 发行版本都将 GCC 作为默认的编译器,其特点如下所示: <ul><li><strong>广泛支持</strong>: 支持各种 Linux 发行版,是大多数开源项目的默认编译器。</li><li><strong>强大的优化</strong>: 提供各种编译优化选项,适合多种性能需求的开发。</li><li><strong>丰富的工具链</strong>: 和 GDBGNU 调试器、Make、Autoconf 等工具无缝集成。</li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>目前而言GCC 已经属于跨平台的项目了,支持 Windows、Linux 和 MacOS ,在 Windows 上 GCC 的移植项目MinGW、Cygwin 以及 MSYS2其差别如下所示</p><ul><li>① MinGW 提供了 GCC 编译器的 Windows 版本,可以生成 Windows 兼容的本地代码。</li><li>② Cygwin 是一个在 Windows 上运行的类 Unix 环境,它提供了一套完整的 POSIX 兼容工具,包括 GCC 编译器。</li><li>③ MSYS2 是一个在 Windows 上运行的轻量级、开源的 Unix-like 环境,它为 Windows 用户提供了类似于 Linux 的开发环境。MSYS2 是 MinGW 和 Cygwin 的后继者,旨在提供更现代化和更强大的开发工具集。</li></ul></div><ul><li>对于 MacOS 而言,使用的最多的 C/C++ 编译器是 <code>Clang/LLVM</code>,其特点如下: <ul><li><strong>Xcode 集成</strong>: 深度集成到 Xcode 中,支持 Apple 的所有平台macOS、iOS、tvOS、watchOS的开发。</li><li><strong>优化和兼容</strong>: 生成的代码针对 Apple 的硬件进行优化,并兼容 GCC 的大部分功能。</li><li><strong>现代化</strong>: Clang 提供了对 C 语言标准的全面支持,并且以其快速的编译速度和易读的错误报告而著称。</li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>在 MacOS 中,尽管 Clang 是默认编译器;但是,也可以 Homebrew 等包管理器来安装 GCC ,以便开发 C/C++ 项目。</p></div><h2 id="_3-3-嵌入式系统" tabindex="-1">3.3 嵌入式系统 <a class="header-anchor" href="#_3-3-嵌入式系统" aria-label="Permalink to &quot;3.3 嵌入式系统&quot;"></a></h2><ul><li><p>在嵌入式系统开发中,可用的 C 语言编译器以及工具链非常丰富, 有很多是免费或开源的,如下所示:</p><ul><li><code>GCC (GNU Compiler Collection)</code> <ul><li>简介GCC 是最广泛使用的开源编译器集合之一,支持多种处理器架构,包括 ARM、AVR、MIPS、RISC-V 等。</li><li>开源或免费:完全开源且免费,受到广泛的社区支持。</li></ul></li><li><code>Clang/LLVM</code> <ul><li>简介Clang 是基于 LLVM 架构的开源编译器,支持多种架构,并且与 GCC 兼容。</li><li>开源或免费:开源且免费,具有快速的编译速度和现代化的代码分析工具。</li></ul></li><li><code>SDCC (Small Device C Compiler)</code> <ul><li>简介: SDCC 是一个开源的跨平台 C 编译器,主要用于 8 位和 16 位微控制器8051、Z80、PIC 等。</li><li>开源或免费:完全开源且免费,适合教育和小型项目开发。</li></ul></li><li><code>MPLAB XC Compilers</code> <ul><li>简介MPLAB XC 是由 Microchip 提供的编译器系列,专门用于其 PIC 和 dsPIC 微控制器。</li><li>开源或免费:提供免费版本(使用标准优化级别),但也有付费版本提供更高级的优化。</li></ul></li><li><code>ARM GCC</code> <ul><li>简介ARM GCC 是 GCC 的一个专门版本,针对 ARM Cortex-M 系列微控制器进行了优化。</li><li>开源或免费:完全开源且免费,广泛用于工业、教育和开源项目中。</li></ul></li><li><code>PlatformIO</code> <ul><li>简介PlatformIO 是一个开源的嵌入式开发生态系统,支持多种开发板、框架和编译器。</li><li>开源或免费:基本功能免费,部分高级功能和插件需要订阅服务。</li></ul></li><li><code>Eclipse</code> <ul><li>简介Eclipse 是一个开源的集成开发环境IDE可以通过插件支持嵌入式开发。</li><li>开源或免费Eclipse 和 GCC 都是开源免费的,适合跨平台开发。</li></ul></li><li><code>Arduino IDE</code> <ul><li>简介Arduino IDE 是一个简单易用的开源开发环境,广泛用于 Arduino 开发板和其他兼容开发板。</li><li>开源或免费:完全开源且免费,非常适合教育和入门级开发。</li></ul></li><li>...</li></ul></li><li><p>这些编译器以及工具链各有优势,开发者应根据目标硬件平台、项目需求和开发环境选择最适合的编译器。</p></li></ul><h2 id="_3-4-c-语言为什么有那么多的编译器" tabindex="-1">3.4 C 语言为什么有那么多的编译器? <a class="header-anchor" href="#_3-4-c-语言为什么有那么多的编译器" aria-label="Permalink to &quot;3.4 C 语言为什么有那么多的编译器?&quot;"></a></h2><ul><li>C 语言并没有一个官方机构,也不属于哪个公司,它只有一个制定标准的委员会,任何其他组织或者个人都可以开发 C 语言的编译器,而这个编译器要遵守哪个 C 语言标准,是 100% 遵守还是部分遵守,并没有强制性的措施,也没有任何约束。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>各个厂商可以为了自己的利益、根据自己的喜好来开发编译器。</p></div><ul><li>这就导致了一个棘手的问题,有的编译器遵守较新的 C 语言标准,有的编译器只能遵守较老的 C 语言标准,有的编译器还进行了很多扩展。比如: <ul><li>GCC、LLVM/Clang 更新非常及时,能够支持最新的 C 语言标准。</li><li>MSVC 更新比较缓慢迟迟不能支持新标准例如VC6.0、VS2010 都在使用 C89 标准VS2015 部分支持 C99 标准。</li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>微软官方给出的答复:最新的标准已经在 C++ 中支持了C 语言就没必要再重复了。</p></div><ul><li>初学者经常会遇到这种情况,有些代码在 MSVC 下能够正常运行,拿到 GCC 下就不行了,一堆报错信息; 或者反过来,在 GCC 上能运行的代码在 MSVC 下不能运行。这是因为不同的编译器支持的标准不同,每个编译器都进行了自己的扩展,假如你使用了 MSVC 自己的扩展函数,那么拿到 GCC 下肯定是不支持的。</li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>在学习的时候,无所谓使用那个 C 语言编译器了;但是,如果要开发实际项目(开源或商业),最好使用 GCC 编译器,因为其功能最强大、开源、跨平台、免费,支持最新的 C 语言标准。</p></div><h1 id="第四章-注释-⭐" tabindex="-1">第四章:注释(⭐) <a class="header-anchor" href="#第四章-注释-⭐" aria-label="Permalink to &quot;第四章:注释(⭐)&quot;"></a></h1><h2 id="_4-1-概述" tabindex="-1">4.1 概述 <a class="header-anchor" href="#_4-1-概述" aria-label="Permalink to &quot;4.1 概述&quot;"></a></h2><ul><li>编程语言中,<code>注释</code>是一种<code>特殊</code>的文本,它不会被编译器执行,而仅用于代码的解释和文档说明。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 注释是一个程序员必须有具有的良好编程习惯。</li><li>② 在实际开发中,程序员可以将自己的思路通过<code>注释</code>整理出来,然后再用<code>代码</code>去实现。</li></ul></div><h2 id="_4-2-单行注释" tabindex="-1">4.2 单行注释 <a class="header-anchor" href="#_4-2-单行注释" aria-label="Permalink to &quot;4.2 单行注释&quot;"></a></h2><ul><li>C 语言中的单行注释的格式,如下所示:</li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 单行注释</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>在 CLion 中的快捷键是 <code>Ctrl + /</code></p></div><ul><li>示例:</li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 这是编译预处理指令</span></span>
<span class="line"><span>-Dconsole.encoding=UTF-8</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div></div><h1 id="第三章-五花八门的-c-语言编译器-⭐" tabindex="-1">第三章:五花八门的 C 语言编译器(⭐) <a class="header-anchor" href="#第三章-五花八门的-c-语言编译器-⭐" aria-label="Permalink to &quot;第三章:五花八门的 C 语言编译器(⭐)&quot;"></a></h1><h2 id="_3-1-概述" tabindex="-1">3.1 概述 <a class="header-anchor" href="#_3-1-概述" aria-label="Permalink to &quot;3.1 概述&quot;"></a></h2><ul><li>由于 C 语言的历史比较久,而且早期没有规范,整个计算机产业也都处于拓荒的年代,所以就涌现了很多款 C 语言编译器,它们各有特点,适用于不同的平台。</li></ul><h2 id="_3-2-桌面操作系统" tabindex="-1">3.2 桌面操作系统 <a class="header-anchor" href="#_3-2-桌面操作系统" aria-label="Permalink to &quot;3.2 桌面操作系统&quot;"></a></h2><ul><li>目前而言,主流的桌面操作系统就是 Windows、Linux 和 MacOS 。</li><li>对于 Windows 而言,使用的最多的 C/C++ 编译器是 <code>MSVC</code> Microsoft Visual C++),被集成在 Visual Studio 开发环境中,其特点如下: <ul><li>① 兼容性: 与 Windows 操作系统和 Windows API 深度集成,生成的二进制文件为 PE 格式。</li><li>② 调试工具: 提供强大的调试工具Visual Studio Debugger。</li><li>③ 优化: 支持各种编译器优化,特别是针对 Windows 平台的优化。</li><li>④ 库支持: 提供丰富的 Windows 专用库,如:<s>MFCMicrosoft Foundation Class Library</s></li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>MSVC 不开源,我们可以使用 Visual Studio Community 社区版,但是如果想使用 Visual Studio Community 社区版生成出来的应用进行商用,就需要好好阅读微软的许可证和说明书了。</p></div><ul><li>对于 Linux 而言,使用的最多的 C/C++ 编译器是 <code>GCC</code>(支持多种架构和语言),并且很多 Linux 发行版本都将 GCC 作为默认的编译器,其特点如下所示: <ul><li>① 广泛支持: 支持各种 Linux 发行版,是大多数开源项目的默认编译器。</li><li>② 强大的优化: 提供各种编译优化选项,适合多种性能需求的开发。</li><li>③ 丰富的工具链: 和 GDBGNU 调试器、Make、Autoconf 等工具无缝集成。</li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>目前而言GCC 已经属于跨平台的项目了,支持 Windows、Linux 和 MacOS ,在 Windows 上 GCC 的移植项目MinGW、Cygwin 以及 MSYS2其差别如下所示</p><ul><li>① MinGW 提供了 GCC 编译器的 Windows 版本,可以生成 Windows 兼容的本地代码。</li><li>② Cygwin 是一个在 Windows 上运行的类 Unix 环境,它提供了一套完整的 POSIX 兼容工具,包括 GCC 编译器。</li><li>③ MSYS2 是一个在 Windows 上运行的轻量级、开源的 Unix-like 环境,它为 Windows 用户提供了类似于 Linux 的开发环境。MSYS2 是 MinGW 和 Cygwin 的后继者,旨在提供更现代化和更强大的开发工具集。</li></ul></div><ul><li>对于 MacOS 而言,使用的最多的 C/C++ 编译器是 <code>Clang/LLVM</code>,其特点如下: <ul><li>① Xcode 集成: 深度集成到 Xcode 中,支持 Apple 的所有平台macOS、iOS、tvOS、watchOS的开发。</li><li>② 优化和兼容: 生成的代码针对 Apple 的硬件进行优化,并兼容 GCC 的大部分功能。</li><li>③ 现代化: Clang 提供了对 C 语言标准的全面支持,并且以其快速的编译速度和易读的错误报告而著称。</li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>在 MacOS 中,尽管 Clang 是默认编译器;但是,也可以 Homebrew 等包管理器来安装 GCC ,以便开发 C/C++ 项目。</p></div><h2 id="_3-3-嵌入式系统" tabindex="-1">3.3 嵌入式系统 <a class="header-anchor" href="#_3-3-嵌入式系统" aria-label="Permalink to &quot;3.3 嵌入式系统&quot;"></a></h2><ul><li><p>在嵌入式系统开发中,可用的 C 语言编译器以及工具链非常丰富, 有很多是免费或开源的,如下所示:</p><ul><li><code>GCC (GNU Compiler Collection)</code> <ul><li>简介GCC 是最广泛使用的开源编译器集合之一,支持多种处理器架构,包括 ARM、AVR、MIPS、RISC-V 等。</li><li>开源或免费:完全开源且免费,受到广泛的社区支持。</li></ul></li><li><code>Clang/LLVM</code> <ul><li>简介Clang 是基于 LLVM 架构的开源编译器,支持多种架构,并且与 GCC 兼容。</li><li>开源或免费:开源且免费,具有快速的编译速度和现代化的代码分析工具。</li></ul></li><li><code>SDCC (Small Device C Compiler)</code> <ul><li>简介: SDCC 是一个开源的跨平台 C 编译器,主要用于 8 位和 16 位微控制器8051、Z80、PIC 等。</li><li>开源或免费:完全开源且免费,适合教育和小型项目开发。</li></ul></li><li><code>MPLAB XC Compilers</code> <ul><li>简介MPLAB XC 是由 Microchip 提供的编译器系列,专门用于其 PIC 和 dsPIC 微控制器。</li><li>开源或免费:提供免费版本(使用标准优化级别),但也有付费版本提供更高级的优化。</li></ul></li><li><code>ARM GCC</code> <ul><li>简介ARM GCC 是 GCC 的一个专门版本,针对 ARM Cortex-M 系列微控制器进行了优化。</li><li>开源或免费:完全开源且免费,广泛用于工业、教育和开源项目中。</li></ul></li><li><code>PlatformIO</code> <ul><li>简介PlatformIO 是一个开源的嵌入式开发生态系统,支持多种开发板、框架和编译器。</li><li>开源或免费:基本功能免费,部分高级功能和插件需要订阅服务。</li></ul></li><li><code>Eclipse</code> <ul><li>简介Eclipse 是一个开源的集成开发环境IDE可以通过插件支持嵌入式开发。</li><li>开源或免费Eclipse 和 GCC 都是开源免费的,适合跨平台开发。</li></ul></li><li><code>Arduino IDE</code> <ul><li>简介Arduino IDE 是一个简单易用的开源开发环境,广泛用于 Arduino 开发板和其他兼容开发板。</li><li>开源或免费:完全开源且免费,非常适合教育和入门级开发。</li></ul></li><li>...</li></ul></li><li><p>这些编译器以及工具链各有优势,开发者应根据目标硬件平台、项目需求和开发环境选择最适合的编译器。</p></li></ul><h2 id="_3-4-c-语言为什么有那么多的编译器" tabindex="-1">3.4 C 语言为什么有那么多的编译器? <a class="header-anchor" href="#_3-4-c-语言为什么有那么多的编译器" aria-label="Permalink to &quot;3.4 C 语言为什么有那么多的编译器?&quot;"></a></h2><ul><li>C 语言并没有一个官方机构,也不属于哪个公司,它只有一个制定标准的委员会,任何其他组织或者个人都可以开发 C 语言的编译器,而这个编译器要遵守哪个 C 语言标准,是 100% 遵守还是部分遵守,并没有强制性的措施,也没有任何约束。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>各个厂商可以为了自己的利益、根据自己的喜好来开发编译器。</p></div><ul><li>这就导致了一个棘手的问题,有的编译器遵守较新的 C 语言标准,有的编译器只能遵守较老的 C 语言标准,有的编译器还进行了很多扩展。比如: <ul><li>GCC、LLVM/Clang 更新非常及时,能够支持最新的 C 语言标准。</li><li>MSVC 更新比较缓慢迟迟不能支持新标准例如VC6.0、VS2010 都在使用 C89 标准VS2015 部分支持 C99 标准。</li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>微软官方给出的答复:最新的标准已经在 C++ 中支持了C 语言就没必要再重复了。</p></div><ul><li>初学者经常会遇到这种情况,有些代码在 MSVC 下能够正常运行,拿到 GCC 下就不行了,一堆报错信息; 或者反过来,在 GCC 上能运行的代码在 MSVC 下不能运行。这是因为不同的编译器支持的标准不同,每个编译器都进行了自己的扩展,假如你使用了 MSVC 自己的扩展函数,那么拿到 GCC 下肯定是不支持的。</li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>在学习的时候,无所谓使用那个 C 语言编译器了;但是,如果要开发实际项目(开源或商业),最好使用 GCC 编译器,因为其功能最强大、开源、跨平台、免费,支持最新的 C 语言标准。</p></div><h1 id="第四章-注释-⭐" tabindex="-1">第四章:注释(⭐) <a class="header-anchor" href="#第四章-注释-⭐" aria-label="Permalink to &quot;第四章:注释(⭐)&quot;"></a></h1><h2 id="_4-1-概述" tabindex="-1">4.1 概述 <a class="header-anchor" href="#_4-1-概述" aria-label="Permalink to &quot;4.1 概述&quot;"></a></h2><ul><li>编程语言中,<code>注释</code>是一种<code>特殊</code>的文本,它不会被编译器执行,而仅用于代码的解释和文档说明。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 注释是一个程序员必须有具有的良好编程习惯。</li><li>② 在实际开发中,程序员可以将自己的思路通过<code>注释</code>整理出来,然后再用<code>代码</code>去实现。</li></ul></div><h2 id="_4-2-单行注释" tabindex="-1">4.2 单行注释 <a class="header-anchor" href="#_4-2-单行注释" aria-label="Permalink to &quot;4.2 单行注释&quot;"></a></h2><ul><li>C 语言中的单行注释的格式,如下所示:</li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 单行注释</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>在 CLion 中的快捷键是 <code>Ctrl + /</code></p></div><ul><li>示例:</li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 这是编译预处理指令</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 定义主函数</span></span>
<span class="line"></span>
@ -205,7 +207,7 @@
<span class="line"><span>SpacesInCStyleCastParentheses: false</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br></div></div><ul><li>CLion 中配置<code>保存</code>的时候<code>自动格式化</code>,即:</li></ul><p><img src="/c/assets/133.D9TSeAa9.gif" alt=""></p><h2 id="_6-5-配置-gitignore-文件" tabindex="-1">6.5 配置 .gitignore 文件 <a class="header-anchor" href="#_6-5-配置-gitignore-文件" aria-label="Permalink to &quot;6.5 配置 .gitignore 文件&quot;"></a></h2><ul><li>需要在项目中,配置 <code>.gitignore</code> 文件,以便在提交代码到 Git 仓库的时候,忽略某些文件或目录,如下所示:</li></ul><p><img src="/c/assets/134.CCRgYIVq.png" alt=""></p><ul><li><code>.gitignore</code> 文件的内容,如下所示:</li></ul><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>.vscode</span></span>
<span class="line"><span>.idea</span></span>
<span class="line"><span>cmake-build-*</span></span>
<span class="line"><span>build</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><h2 id="_6-6-演示" tabindex="-1">6.6 演示 <a class="header-anchor" href="#_6-6-演示" aria-label="Permalink to &quot;6.6 演示&quot;"></a></h2><ul><li>我们可以在项目中,临时创建或复制一个文件,看上述配置是否生效,即:</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>如果是复制并粘贴一个文件到项目中,请点击<code>重新加载 CMake 项目</code></p></div><p><img src="/c/assets/135.C1t2T6FV.gif" alt=""></p><h1 id="第七章-c-语言的编译过程-⭐" tabindex="-1">第七章C 语言的编译过程(⭐) <a class="header-anchor" href="#第七章-c-语言的编译过程-⭐" aria-label="Permalink to &quot;第七章C 语言的编译过程(⭐)&quot;"></a></h1><h2 id="_7-1-概述" tabindex="-1">7.1 概述 <a class="header-anchor" href="#_7-1-概述" aria-label="Permalink to &quot;7.1 概述&quot;"></a></h2><ul><li>C 程序的编译过程,如下所示:</li></ul><p><img src="/c/assets/136.Rqa4uHq6.png" alt=""></p><ul><li>过程 ① :编写(编辑)源代码,即:编写 C 语言源程序代码,并以文件的形式存储在磁盘中。</li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>源程序需要以 <code>.c</code> 作为扩展名。</p></div><ul><li>过程 ② :编译,即:将 C 语言源程序转换为<code>目标程序(或目标文件)</code>。如果程序没有错误,没有任何提示,就会生成一个扩展名为 <code>.obj</code><code>.o</code> 的二进制文件。C 语言中的每条可执行语句经过编译之后,最终都会转换为二进制的机器指令。</li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li><p>① 其实,<code>编译阶段</code>包含了<code>预处理</code><code>编译</code><code>汇编</code></p></li><li><p><code>预处理</code>是编译过程的第一个阶段。在这个阶段,预处理器处理源代码中的指令(例如:<code>#include</code><code>#define</code>等),主要任务包括:</p><ul><li><p><strong>头文件包含</strong>:将头文件的内容插入到源文件中。例如:<code>#include &lt;stdio.h&gt;</code>会被替换为<code>stdio.h</code>文件的内容。</p></li><li><p><strong>宏展开</strong>:替换宏定义。例如:<code>#define PI 3.14</code>会将代码中的<code>PI</code>替换为<code>3.14</code></p></li><li><p><strong>条件编译</strong>:根据条件指令(如:<code>#ifdef</code><code>#ifndef</code>)有选择地编译代码。</p></li><li><p><strong>删除代码中的注释,但是不会进行语法检查</strong></p></li><li><p>预处理完成后,生成一个扩展名为<code>.i</code>的中间文件。</p></li></ul></li><li><p><code>编译</code>是将预处理后的源代码转换为汇编代码的过程。在这个阶段,编译器会检查代码的语法和语义,将其转换为目标机器的汇编语言,生成一个扩展名为<code>.s</code>的汇编文件。</p></li><li><p><code>汇编</code>是将汇编代码转换为机器代码(也称为目标代码或目标文件)的过程。在这个阶段,汇编器将汇编指令转换为二进制机器指令,生成一个扩展名为<code>.o</code><code>.obj</code>的目标文件。</p></li></ul></div><ul><li>过程 ③ :链接(连接),即:将编译形成的目标文件 <code>*.obj</code><code>*.o</code>和库函数以及其他目录文件<code>链接</code>,形成一个统一的二进制文件 <code>*.exe</code></li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li>为什么需要链接库文件?</li><li>因为我们的 C 程序会使用 C 程序库中的内容,如:<code>&lt;stdio.h&gt;</code> 中的 <code>printf()</code> 函数,这些函数不是程序员自己写的,而是 C 程序库中提供的因此需要链接。其实在链接过程中还会加入启动代码这个启动代码和系统相关Linux 下主要有 crt0.c、crti.c 等,它们设置堆栈后,再调用 main() 函数)负责初始化程序运行时的环境。</li></ul></div><ul><li>过程 ④ :执行,即:有了可执行的 <code>*.exe</code>文件,我们就可以在控制台上执行运行此 <code>*.exe</code> 文件。</li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>如果<code>修改</code>了源代码,还需要重新<code>编译</code><code>链接</code>,并生成新的 <code>*.exe</code>文件,再执行,方能生效。</p></div><h2 id="_7-2-gcc-编译器的介绍" tabindex="-1">7.2 GCC 编译器的介绍 <a class="header-anchor" href="#_7-2-gcc-编译器的介绍" aria-label="Permalink to &quot;7.2 GCC 编译器的介绍&quot;"></a></h2><ul><li>编辑器vim 、vscode 等,是指我们用它来编写源程序的(编辑代码),而我们写的代码语句,电脑是不懂的,我们需要把它转成电脑能懂的语句,编译器就是这样的转化工具。换言之,我们用编辑器编写程序,由编译器编译后才可以运行!</li><li>编译器是将易于编写、阅读和维护的高级计算机语言翻译为计算机能解读、运行的低级机器语言的程序。</li><li>gccGNU Compiler CollectionGNU 编译器套件),是由 GNU 开发的编程语言编译器。gcc 原本作为 GNU 操作系统的官方编译器,现已被大多数类 Unix 操作系统Linux、BSD、Mac OS X 等采纳为标准的编译器gcc 同样适用于微软的 Windows 。</li><li>gcc 最初用于编译 C 语言,随着项目的发展, gcc 已经成为了能够编译 C、C++、Java、Ada、fortran、Object C、Object C++、Go 语言的编译器大家族。</li></ul><h2 id="_7-3-通过-gcc-直接生成可执行文件" tabindex="-1">7.3 通过 gcc 直接生成可执行文件 <a class="header-anchor" href="#_7-3-通过-gcc-直接生成可执行文件" aria-label="Permalink to &quot;7.3 通过 gcc 直接生成可执行文件&quot;"></a></h2><ul><li>示例:进行预处理、编译、汇编和链接</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.exe</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/137.6yQYnjOa.gif" alt=""></p><h2 id="_7-4-通过-gcc-分步编译" tabindex="-1">7.4 通过 gcc 分步编译 <a class="header-anchor" href="#_7-4-通过-gcc-分步编译" aria-label="Permalink to &quot;7.4 通过 gcc 分步编译&quot;"></a></h2><h3 id="_7-3-1-概述" tabindex="-1">7.3.1 概述 <a class="header-anchor" href="#_7-3-1-概述" aria-label="Permalink to &quot;7.3.1 概述&quot;"></a></h3><ul><li>预处理命令:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -E</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 源文件.c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 源文件.i</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # 通常以 .i 结尾表示这个文件是一个中间状态</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><ul><li>编译(预处理和编译)命令:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -S</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 源文件.i</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 源文件.s</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # 在 Linux 中,通常以 .s 结尾;在 Windows 中,通常以 .asm 结尾</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><ul><li>汇编(预处理、编译和汇编)命令:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -c</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 源文件.s</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 源文件.o</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # 在 Linux 中,通常以 .o 结尾;在 Windows 中,通常以 .obj 结尾</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><ul><li>链接(预处理、编译、汇编和链接)命令:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 源文件.o</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 源文件.exe</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # 在 Linux 中,通常以 .out 结尾;在 Windows 中,通常以 .exe 结尾</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><h3 id="_7-4-2-应用示例" tabindex="-1">7.4.2 应用示例 <a class="header-anchor" href="#_7-4-2-应用示例" aria-label="Permalink to &quot;7.4.2 应用示例&quot;"></a></h3><ul><li>示例:只进行预处理</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -E</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.i</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/138.hYR9GiiD.gif" alt=""></p><ul><li>示例:只进行预处理和编译</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -S</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.i</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.s</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/139.D3b-QIrA.gif" alt=""></p><ul><li>示例:只进行预处理、编译和汇编</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -c</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.s</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.o</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/140.DGbA6qsW.gif" alt=""></p><ul><li>示例:进行预处理、编译、汇编和链接</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.o</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.exe</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/141.BToOkxf2.gif" alt=""></p><h1 id="第八章-附录" tabindex="-1">第八章:附录 <a class="header-anchor" href="#第八章-附录" aria-label="Permalink to &quot;第八章:附录&quot;"></a></h1><h2 id="_8-1-wsl2-代理问题" tabindex="-1">8.1 WSL2 代理问题 <a class="header-anchor" href="#_8-1-wsl2-代理问题" aria-label="Permalink to &quot;8.1 WSL2 代理问题&quot;"></a></h2><ul><li>在安装和配置 WSL2 之后,可能会出现如下的提示,即:</li></ul><p><img src="/c/assets/142.C3wekjfY.png" alt=""></p><ul><li>那么,只需要修改 <code>%USERPROFILE%\.wslconfig</code>文件,内容如下:</li></ul><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>[wsl2]</span></span>
<span class="line"><span>build</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><h2 id="_6-6-演示" tabindex="-1">6.6 演示 <a class="header-anchor" href="#_6-6-演示" aria-label="Permalink to &quot;6.6 演示&quot;"></a></h2><ul><li>我们可以在项目中,临时创建或复制一个文件,看上述配置是否生效,即:</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>如果是复制并粘贴一个文件到项目中,请点击<code>重新加载 CMake 项目</code></p></div><p><img src="/c/assets/135.C1t2T6FV.gif" alt=""></p><h1 id="第七章-c-语言的编译过程-⭐" tabindex="-1">第七章C 语言的编译过程(⭐) <a class="header-anchor" href="#第七章-c-语言的编译过程-⭐" aria-label="Permalink to &quot;第七章C 语言的编译过程(⭐)&quot;"></a></h1><h2 id="_7-1-概述" tabindex="-1">7.1 概述 <a class="header-anchor" href="#_7-1-概述" aria-label="Permalink to &quot;7.1 概述&quot;"></a></h2><ul><li>C 程序的编译过程,如下所示:</li></ul><p><img src="/c/assets/136.Rqa4uHq6.png" alt=""></p><ul><li>过程 ① :编写(编辑)源代码,即:编写 C 语言源程序代码,并以文件的形式存储在磁盘中。</li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>源程序需要以 <code>.c</code> 作为扩展名。</p></div><ul><li>过程 ② :编译,即:将 C 语言源程序转换为<code>目标程序(或目标文件)</code>。如果程序没有错误,没有任何提示,就会生成一个扩展名为 <code>.obj</code><code>.o</code> 的二进制文件。C 语言中的每条可执行语句经过编译之后,最终都会转换为二进制的机器指令。</li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li><p>① 其实,<code>编译阶段</code>包含了<code>预处理</code><code>编译</code><code>汇编</code></p></li><li><p><code>预处理</code>是编译过程的第一个阶段。在这个阶段,预处理器处理源代码中的指令(例如:<code>#include</code><code>#define</code>等),主要任务包括:</p><ul><li><p>头文件包含:将头文件的内容插入到源文件中。例如:<code>#include &lt;stdio.h&gt;</code>会被替换为<code>stdio.h</code>文件的内容。</p></li><li><p>宏展开:替换宏定义。例如:<code>#define PI 3.14</code>会将代码中的<code>PI</code>替换为<code>3.14</code></p></li><li><p>条件编译:根据条件指令(如:<code>#ifdef</code><code>#ifndef</code>)有选择地编译代码。</p></li><li><p>删除代码中的注释,但是不会进行语法检查。</p></li><li><p>预处理完成后,生成一个扩展名为<code>.i</code>的中间文件。</p></li></ul></li><li><p><code>编译</code>是将预处理后的源代码转换为汇编代码的过程。在这个阶段,编译器会检查代码的语法和语义,将其转换为目标机器的汇编语言,生成一个扩展名为<code>.s</code>的汇编文件。</p></li><li><p><code>汇编</code>是将汇编代码转换为机器代码(也称为目标代码或目标文件)的过程。在这个阶段,汇编器将汇编指令转换为二进制机器指令,生成一个扩展名为<code>.o</code><code>.obj</code>的目标文件。</p></li></ul></div><ul><li>过程 ③ :链接(连接),即:将编译形成的目标文件 <code>*.obj</code><code>*.o</code>和库函数以及其他目录文件<code>链接</code>,形成一个统一的二进制文件 <code>*.exe</code></li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li>为什么需要链接库文件?</li><li>因为我们的 C 程序会使用 C 程序库中的内容,如:<code>&lt;stdio.h&gt;</code> 中的 <code>printf()</code> 函数,这些函数不是程序员自己写的,而是 C 程序库中提供的因此需要链接。其实在链接过程中还会加入启动代码这个启动代码和系统相关Linux 下主要有 crt0.c、crti.c 等,它们设置堆栈后,再调用 main() 函数)负责初始化程序运行时的环境。</li></ul></div><ul><li>过程 ④ :执行,即:有了可执行的 <code>*.exe</code>文件,我们就可以在控制台上执行运行此 <code>*.exe</code> 文件。</li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>如果<code>修改</code>了源代码,还需要重新<code>编译</code><code>链接</code>,并生成新的 <code>*.exe</code>文件,再执行,方能生效。</p></div><h2 id="_7-2-gcc-编译器的介绍" tabindex="-1">7.2 GCC 编译器的介绍 <a class="header-anchor" href="#_7-2-gcc-编译器的介绍" aria-label="Permalink to &quot;7.2 GCC 编译器的介绍&quot;"></a></h2><ul><li>编辑器vim 、vscode 等,是指我们用它来编写源程序的(编辑代码),而我们写的代码语句,电脑是不懂的,我们需要把它转成电脑能懂的语句,编译器就是这样的转化工具。换言之,我们用编辑器编写程序,由编译器编译后才可以运行!</li><li>编译器是将易于编写、阅读和维护的高级计算机语言翻译为计算机能解读、运行的低级机器语言的程序。</li><li>gccGNU Compiler CollectionGNU 编译器套件),是由 GNU 开发的编程语言编译器。gcc 原本作为 GNU 操作系统的官方编译器,现已被大多数类 Unix 操作系统Linux、BSD、Mac OS X 等采纳为标准的编译器gcc 同样适用于微软的 Windows 。</li><li>gcc 最初用于编译 C 语言,随着项目的发展, gcc 已经成为了能够编译 C、C++、Java、Ada、fortran、Object C、Object C++、Go 语言的编译器大家族。</li></ul><h2 id="_7-3-通过-gcc-直接生成可执行文件" tabindex="-1">7.3 通过 gcc 直接生成可执行文件 <a class="header-anchor" href="#_7-3-通过-gcc-直接生成可执行文件" aria-label="Permalink to &quot;7.3 通过 gcc 直接生成可执行文件&quot;"></a></h2><ul><li>示例:进行预处理、编译、汇编和链接</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.exe</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/137.6yQYnjOa.gif" alt=""></p><h2 id="_7-4-通过-gcc-分步编译" tabindex="-1">7.4 通过 gcc 分步编译 <a class="header-anchor" href="#_7-4-通过-gcc-分步编译" aria-label="Permalink to &quot;7.4 通过 gcc 分步编译&quot;"></a></h2><h3 id="_7-3-1-概述" tabindex="-1">7.3.1 概述 <a class="header-anchor" href="#_7-3-1-概述" aria-label="Permalink to &quot;7.3.1 概述&quot;"></a></h3><ul><li>预处理命令:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -E</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 源文件.c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 源文件.i</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # 通常以 .i 结尾表示这个文件是一个中间状态</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><ul><li>编译(预处理和编译)命令:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -S</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 源文件.i</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 源文件.s</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # 在 Linux 中,通常以 .s 结尾;在 Windows 中,通常以 .asm 结尾</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><ul><li>汇编(预处理、编译和汇编)命令:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -c</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 源文件.s</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 源文件.o</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # 在 Linux 中,通常以 .o 结尾;在 Windows 中,通常以 .obj 结尾</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><ul><li>链接(预处理、编译、汇编和链接)命令:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 源文件.o</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 源文件.exe</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # 在 Linux 中,通常以 .out 结尾;在 Windows 中,通常以 .exe 结尾</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><h3 id="_7-4-2-应用示例" tabindex="-1">7.4.2 应用示例 <a class="header-anchor" href="#_7-4-2-应用示例" aria-label="Permalink to &quot;7.4.2 应用示例&quot;"></a></h3><ul><li>示例:只进行预处理</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -E</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.i</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/138.hYR9GiiD.gif" alt=""></p><ul><li>示例:只进行预处理和编译</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -S</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.i</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.s</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/139.D3b-QIrA.gif" alt=""></p><ul><li>示例:只进行预处理、编译和汇编</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -c</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.s</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.o</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/140.DGbA6qsW.gif" alt=""></p><ul><li>示例:进行预处理、编译、汇编和链接</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.o</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.exe</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/141.BToOkxf2.gif" alt=""></p><h1 id="第八章-附录" tabindex="-1">第八章:附录 <a class="header-anchor" href="#第八章-附录" aria-label="Permalink to &quot;第八章:附录&quot;"></a></h1><h2 id="_8-1-wsl2-代理问题" tabindex="-1">8.1 WSL2 代理问题 <a class="header-anchor" href="#_8-1-wsl2-代理问题" aria-label="Permalink to &quot;8.1 WSL2 代理问题&quot;"></a></h2><ul><li>在安装和配置 WSL2 之后,可能会出现如下的提示,即:</li></ul><p><img src="/c/assets/142.C3wekjfY.png" alt=""></p><ul><li>那么,只需要修改 <code>%USERPROFILE%\.wslconfig</code>文件,内容如下:</li></ul><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>[wsl2]</span></span>
<span class="line"><span>networkingMode=mirrored</span></span>
<span class="line"><span>dnsTunneling=true</span></span>
<span class="line"><span>firewall=true</span></span>
@ -302,8 +304,8 @@
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libelf++0</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libbfb0-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> python-dev-is-python3</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><p><img src="/c/assets/160.BPOK9irZ.gif" alt=""></p><ul><li>下载源码:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clone</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --depth</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --single-branch</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --branch=linux-msft-wsl-${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">KERNEL_VERSION</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://github.com/microsoft/WSL2-Linux-Kernel.git</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><p><img src="/c/assets/161.B1eB55rC.gif" alt=""></p><ul><li>编译内核代码:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> WSL2-Linux-Kernel</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">make</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -j</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">nproc</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">KCONFIG_CONFIG=Microsoft/config-wsl</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/162.VIcU-hkN.gif" alt=""></p><ul><li>编译 perf 工具:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> tools/perf</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">make</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clean</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">make</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/163.BM9viRZJ.gif" alt=""></p><ul><li>复制到 PATH 变量所指向的路径中:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">cp</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> perf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /usr/bin/</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/164.DpMBA1SK.gif" alt=""></p><h3 id="_8-4-3-整合" tabindex="-1">8.4.3 整合 <a class="header-anchor" href="#_8-4-3-整合" aria-label="Permalink to &quot;8.4.3 整合&quot;"></a></h3><ul><li>CLion 中配置 perf 的路径:</li></ul><p><img src="/c/assets/165.DgXuU6LF.png" alt=""></p><ul><li>在 CLion 中通过 perf 运行代码:</li></ul><p><img src="/c/assets/166.Dnw73s2h.gif" alt=""></p><h2 id="_8-5-win-中文乱码问题" tabindex="-1">8.5 Win 中文乱码问题 <a class="header-anchor" href="#_8-5-win-中文乱码问题" aria-label="Permalink to &quot;8.5 Win 中文乱码问题&quot;"></a></h2><ul><li>前文,我们提及到,在 Win 中,如果出现<code>中文乱码</code>问题,就需要去<code>语言和区别</code>设置<code>系统区域</code>的编码为 UTF-8 但是这样可能会造成其它的软件出现中文乱码问题Xshell 等。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 之所以,修改系统的编码为 UTF-8 会出现问题,是因为早期的 Win 系统的中文默认编码是 GBK目前也是Win 并没有强制第三方软件使用 UTF-8 编码) ,而 Xshell 等也使用的这些编码,一旦我们修改为 UTF-8 之后,可能会造成这些第三方软件出现中文乱码问题(第三方软件适配问题,相信将来应该都会切换为 UTF-8 编码),体验较差!!!</li><li>② 在 Linux 或 MacOS 之所以不会出现中文乱码的问题,是因为这些系统默认的编码就是 UTF-8 。</li></ul></div><ul><li>其实,还有一种解决方案,如下所示:</li></ul><p><img src="/c/assets/167.SnFXRSaL.png" alt=""></p><p><img src="/c/assets/168.DnoEqOjV.png" alt=""></p><p><img src="/c/assets/169.BJBdn7pw.png" alt=""></p><ul><li>测试一下,是否配置成功:</li></ul><p><img src="/c/assets/170.DXtQWYsM.gif" alt=""></p><h2 id="_8-6-clion-中自动导入头文件" tabindex="-1">8.6 CLion 中自动导入头文件 <a class="header-anchor" href="#_8-6-clion-中自动导入头文件" aria-label="Permalink to &quot;8.6 CLion 中自动导入头文件&quot;"></a></h2><ul><li>在 CLion 中,最为强大的功能就是直接输入函数,然后让 IDE 帮我们自动导入头文件,包括自定义的头文件,相当实用。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① CLion 中的<code>自动导入头文件</code><code>快捷键</code><code>Alt + Enter</code></li><li>② CLion 中的<code>自动提取变量的类型</code><code>快捷键</code><code>Ctrl + Alt + V</code></li></ul></div><p><img src="/c/assets/171.hcERTQkN.gif" alt=""></p><ul><li>开启自动导入头文件的步骤,如下所示:</li></ul><p><img src="/c/assets/172.CioraEUv.png" alt=""></p><p><img src="/c/assets/173.kWHWwnc_.png" alt=""></p></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><div class="edit-info" data-v-e257564d><!----><div class="last-updated" data-v-e257564d><p class="VPLastUpdated" data-v-e257564d data-v-e98dd255>上次更新: <time datetime="2024-08-09T09:16:15.000Z" data-v-e98dd255></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><a class="VPLink link pager-link prev" href="/c/notes/01_c-basic/00_xdx/" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>上一篇</span><span class="title" data-v-e257564d>编程基础</span><!--]--></a></div><div class="pager" data-v-e257564d><a class="VPLink link pager-link next" href="/c/notes/01_c-basic/02_xdx/" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>下一篇</span><span class="title" data-v-e257564d>变量和进制</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-5d98c3a5 data-v-e315a0ad><div class="container" data-v-e315a0ad><p class="message" data-v-e315a0ad>Released under the MIT License.</p><p class="copyright" data-v-e315a0ad>Copyright © 2024 许大仙</p></div></footer><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DynzO91I\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://github.com/microsoft/WSL2-Linux-Kernel.git</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><p><img src="/c/assets/161.B1eB55rC.gif" alt=""></p><ul><li>编译内核代码:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> WSL2-Linux-Kernel</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">make</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -j</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">nproc</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">KCONFIG_CONFIG=Microsoft/config-wsl</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/162.VIcU-hkN.gif" alt=""></p><ul><li>编译 perf 工具:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> tools/perf</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">make</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clean</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">make</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/163.BM9viRZJ.gif" alt=""></p><ul><li>复制到 PATH 变量所指向的路径中:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">cp</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> perf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /usr/bin/</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/164.DpMBA1SK.gif" alt=""></p><h3 id="_8-4-3-整合" tabindex="-1">8.4.3 整合 <a class="header-anchor" href="#_8-4-3-整合" aria-label="Permalink to &quot;8.4.3 整合&quot;"></a></h3><ul><li>CLion 中配置 perf 的路径:</li></ul><p><img src="/c/assets/165.DgXuU6LF.png" alt=""></p><ul><li>在 CLion 中通过 perf 运行代码:</li></ul><p><img src="/c/assets/166.Dnw73s2h.gif" alt=""></p><h2 id="_8-5-win-中文乱码问题" tabindex="-1">8.5 Win 中文乱码问题 <a class="header-anchor" href="#_8-5-win-中文乱码问题" aria-label="Permalink to &quot;8.5 Win 中文乱码问题&quot;"></a></h2><ul><li>前文,我们提及到,在 Win 中,如果出现<code>中文乱码</code>问题,就需要去<code>语言和区别</code>设置<code>系统区域</code>的编码为 UTF-8 但是这样可能会造成其它的软件出现中文乱码问题Xshell 等。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 之所以,修改系统的编码为 UTF-8 会出现问题,是因为早期的 Win 系统的中文默认编码是 GBK目前也是Win 并没有强制第三方软件使用 UTF-8 编码) ,而 Xshell 等也使用的这些编码,一旦我们修改为 UTF-8 之后,可能会造成这些第三方软件出现中文乱码问题(第三方软件适配问题,相信将来应该都会切换为 UTF-8 编码),体验较差!!!</li><li>② 在 Linux 或 MacOS 之所以不会出现中文乱码的问题,是因为这些系统默认的编码就是 UTF-8 。</li></ul></div><ul><li>其实,还有一种解决方案,如下所示:</li></ul><p><img src="/c/assets/167.SnFXRSaL.png" alt=""></p><p><img src="/c/assets/168.DnoEqOjV.png" alt=""></p><p><img src="/c/assets/169.BJBdn7pw.png" alt=""></p><ul><li>测试一下,是否配置成功:</li></ul><p><img src="/c/assets/170.DXtQWYsM.gif" alt=""></p><h2 id="_8-6-clion-中自动导入头文件" tabindex="-1">8.6 CLion 中自动导入头文件 <a class="header-anchor" href="#_8-6-clion-中自动导入头文件" aria-label="Permalink to &quot;8.6 CLion 中自动导入头文件&quot;"></a></h2><ul><li>在 CLion 中,最为强大的功能就是直接输入函数,然后让 IDE 帮我们自动导入头文件,包括自定义的头文件,相当实用。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① CLion 中的<code>自动导入头文件</code><code>快捷键</code><code>Alt + Enter</code></li><li>② CLion 中的<code>自动提取变量的类型</code><code>快捷键</code><code>Ctrl + Alt + V</code></li></ul></div><p><img src="/c/assets/171.hcERTQkN.gif" alt=""></p><ul><li>开启自动导入头文件的步骤,如下所示:</li></ul><p><img src="/c/assets/172.CioraEUv.png" alt=""></p><p><img src="/c/assets/173.kWHWwnc_.png" alt=""></p></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><div class="edit-info" data-v-e257564d><!----><div class="last-updated" data-v-e257564d><p class="VPLastUpdated" data-v-e257564d data-v-e98dd255>上次更新: <time datetime="2024-08-11T05:40:37.000Z" data-v-e98dd255></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><a class="VPLink link pager-link prev" href="/c/notes/01_c-basic/00_xdx/" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>上一篇</span><span class="title" data-v-e257564d>编程基础</span><!--]--></a></div><div class="pager" data-v-e257564d><a class="VPLink link pager-link next" href="/c/notes/01_c-basic/02_xdx/" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>下一篇</span><span class="title" data-v-e257564d>变量和进制</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-5d98c3a5 data-v-e315a0ad><div class="container" data-v-e315a0ad><p class="message" data-v-e315a0ad>Released under the MIT License.</p><p class="copyright" data-v-e315a0ad>Copyright © 2024 许大仙</p></div></footer><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DEs09TjE\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
</body>
</html>

View File

@ -8,9 +8,9 @@
<meta name="generator" content="VitePress v1.3.2">
<link rel="preload stylesheet" href="/c/assets/style.8enJ9bsK.css" as="style">
<script type="module" src="/c/assets/app.DS7FIVmo.js"></script>
<script type="module" src="/c/assets/app.DOv65PSF.js"></script>
<link rel="preload" href="/c/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
<link rel="modulepreload" href="/c/assets/chunks/theme.BqwVBBaA.js">
<link rel="modulepreload" href="/c/assets/chunks/theme.CfoaGUmH.js">
<link rel="modulepreload" href="/c/assets/chunks/framework.CZRoMP2i.js">
<link rel="modulepreload" href="/c/assets/notes_01_c-basic_02_xdx_index.md.BaRUI6ln.lean.js">
<link rel="shortcut icon" href="/c//logo.svg">
@ -260,7 +260,7 @@
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br></div></div><h2 id="_3-3-进制的运算规则" tabindex="-1">3.3 进制的运算规则 <a class="header-anchor" href="#_3-3-进制的运算规则" aria-label="Permalink to &quot;3.3 进制的运算规则&quot;"></a></h2><ul><li><code>十进制</code>的运算规则,如下所示: <ul><li><code></code><code></code>(针对加法而言)。</li><li><code></code><code></code>(针对减法而言)。</li></ul></li><li><code>二进制</code>的运算规则,如下所示: <ul><li><code></code><code></code>(针对加法而言)。</li><li><code></code><code></code>(针对减法而言)。</li></ul></li><li><code>八进制</code>的运算规则,如下所示: <ul><li><code></code><code></code>(针对加法而言)。</li><li><code></code><code></code>(针对减法而言)。</li></ul></li><li><code>十六进制</code>的运算规则,如下所示: <ul><li><code>十六</code><code></code>(针对加法而言)。</li><li><code></code><code>十六</code>(针对减法而言)。</li></ul></li></ul><h2 id="_3-4-进制的转换" tabindex="-1">3.4 进制的转换 <a class="header-anchor" href="#_3-4-进制的转换" aria-label="Permalink to &quot;3.4 进制的转换&quot;"></a></h2><h3 id="_3-4-1-概述" tabindex="-1">3.4.1 概述 <a class="header-anchor" href="#_3-4-1-概述" aria-label="Permalink to &quot;3.4.1 概述&quot;"></a></h3><ul><li>不同进制的转换,如下所示:</li></ul><p><img src="/c/assets/19.uqLiL_yu.png" alt=""></p><ul><li>在计算机中,数据是从右往左的方式排列的;其中,最右边的是低位,最左边的是高位,即:</li></ul><p><img src="/c/assets/20.CkykpHY2.png" alt=""></p><h3 id="_3-4-2-二进制和十进制的转换" tabindex="-1">3.4.2 二进制和十进制的转换 <a class="header-anchor" href="#_3-4-2-二进制和十进制的转换" aria-label="Permalink to &quot;3.4.2 二进制和十进制的转换&quot;"></a></h3><h4 id="_3-4-2-1-二进制转换为十进制" tabindex="-1">3.4.2.1 二进制转换为十进制 <a class="header-anchor" href="#_3-4-2-1-二进制转换为十进制" aria-label="Permalink to &quot;3.4.2.1 二进制转换为十进制&quot;"></a></h4><ul><li>规则:从最低位开始,将每个位上的数提取出来,乘以 2 的 (位数 - 1 )次方,然后求和。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 在学术界,将这种计算规则,称为<code>位权相加法</code></li><li><code>八进制转换为十进制</code><code>十六进制转换为十进制</code><code>二进制转换为十进制</code>的算法相同!!!</li></ul></div><ul><li>示例:十进制转十进制</li></ul><p><img src="/c/assets/21.DV1YbrOP.png" alt=""></p><ul><li>示例:二进制转十进制</li></ul><p><img src="/c/assets/22.AHNJT9TV.png" alt=""></p><h4 id="_3-4-2-2-十进制转换二进制" tabindex="-1">3.4.2.2 十进制转换二进制 <a class="header-anchor" href="#_3-4-2-2-十进制转换二进制" aria-label="Permalink to &quot;3.4.2.2 十进制转换二进制&quot;"></a></h4><ul><li>规则:将该数不断除以 2 ,直到商为 0 为止,然后将每步得到的余数倒过来,就是对应的二进制。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 在学术界,将这种计算规则,称为<code>短除法</code><code>连续除2取余法</code></li><li>② 很好理解,只有不断地除以 2 ,就能保证最大的数字不超过 2 ,这不就是二进制(只能有 0 或 1</li><li><code>八进制转换为二进制</code><code>十六进制转换为二进制</code><code>十进制转换为二进制</code>的算法相同!!!</li></ul></div><ul><li>示例:十进制转十进制</li></ul><p><img src="/c/assets/23.Bs-MOwx2.png" alt=""></p><ul><li>示例:十进制转二进制</li></ul><p><img src="/c/assets/24.StzjmBz-.png" alt=""></p><h3 id="_3-4-3-二进制转八进制" tabindex="-1">3.4.3 二进制转八进制 <a class="header-anchor" href="#_3-4-3-二进制转八进制" aria-label="Permalink to &quot;3.4.3 二进制转八进制&quot;"></a></h3><ul><li><p>规则:每 3 位二进制就是一个八进制。</p></li><li><p>示例011 101 001 -&gt; 351</p></li></ul><p><img src="/c/assets/25.C0wVWaxD.png" alt=""></p><h3 id="_3-4-4-二进制转十六进制" tabindex="-1">3.4.4 二进制转十六进制 <a class="header-anchor" href="#_3-4-4-二进制转十六进制" aria-label="Permalink to &quot;3.4.4 二进制转十六进制&quot;"></a></h3><ul><li><p>规则:每 4 位二进制就是一个十六进制。</p></li><li><p>示例1110 1001 -&gt; 0xE9</p></li></ul><p><img src="/c/assets/26.LXJMAihe.png" alt=""></p><h2 id="_3-5-原码、反码和补码" tabindex="-1">3.5 原码、反码和补码 <a class="header-anchor" href="#_3-5-原码、反码和补码" aria-label="Permalink to &quot;3.5 原码、反码和补码&quot;"></a></h2><h3 id="_3-5-1-概述" tabindex="-1">3.5.1 概述 <a class="header-anchor" href="#_3-5-1-概述" aria-label="Permalink to &quot;3.5.1 概述&quot;"></a></h3><ul><li>机器数一个数在计算机的存储形式是二进制我们称这些二进制数为机器数。机器数可以是有符号的用机器数的最高位来存放符号位0 表示正数1 表示负数。</li></ul><p><img src="/c/assets/27._UTCq3PD.png" alt=""></p><ul><li>真值:因为机器数带有符号位,所以机器数的形式值不等于其真实表示的值(真值),以机器数 1000 0001 为例,其真正表示的值(首位是符号位)为 -1而形式值却是 129 ,因此将带有符号位的机器数的真正表示的值称为机器数的真值。</li></ul><p><img src="/c/assets/28.BjQ5kBL-.png" alt=""></p><h3 id="_3-5-2-原码" tabindex="-1">3.5.2 原码 <a class="header-anchor" href="#_3-5-2-原码" aria-label="Permalink to &quot;3.5.2 原码&quot;"></a></h3><ul><li>原码的表示与机器数真值表示的一样,即用第一位表示符号,其余位表示数值。</li><li>规则: <ul><li>正数的<code>原码</code>是它本身对应的二进制数,符号位是 0 。</li><li>负数的<code>原码</code>是它本身绝对值对应的二进制数,但是符号位是 1 。</li></ul></li><li>+1 的原码,使用 8 位二进数来表示,就是:</li></ul><table tabindex="0"><thead><tr><th>十进制数</th><th>原码8位二进制数</th></tr></thead><tbody><tr><td>+1</td><td><code>0</code>000 0001</td></tr></tbody></table><ul><li>-1 的原码,使用 8 位二进数来表示,就是:</li></ul><table tabindex="0"><thead><tr><th>十进制数</th><th>原码8位二进制数</th></tr></thead><tbody><tr><td>-1</td><td><code>1</code>000 0001</td></tr></tbody></table><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>按照原码的规则,会出现 <code>+0</code><code>-0</code> 的情况,即:<code>0</code>000 0000+0<code>1</code>000 0000-0显然不符合实际情况所以计算机底层虽然存储和计算的都是二进数但显然不是原码。</p></div><h3 id="_3-5-3-反码" tabindex="-1">3.5.3 反码 <a class="header-anchor" href="#_3-5-3-反码" aria-label="Permalink to &quot;3.5.3 反码&quot;"></a></h3><ul><li><p>规则:</p><ul><li>正数的反码和它的原码相同。</li><li>负数的反码是在其原码的基础上,符号位不变,其余各位取反。</li></ul></li><li><p>+1 的反码,使用 8 位二进数来表示,就是:</p></li></ul><table tabindex="0"><thead><tr><th>十进制数</th><th>原码8位二进制数</th><th>反码8位二进制数</th></tr></thead><tbody><tr><td>+1</td><td><code>0</code>000 0001</td><td><code>0</code>000 0001</td></tr></tbody></table><ul><li>-1 的反码,使用 8 位二进数来表示,就是:</li></ul><table tabindex="0"><thead><tr><th>十进制数</th><th>原码8位二进制数</th><th>反码8位二进制数</th></tr></thead><tbody><tr><td>-1</td><td><code>1</code>000 0001</td><td><code>1</code>111 1110</td></tr></tbody></table><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>按照反码的规则,如果是 <code>+0</code>,对应的原码是 <code>0</code>000 0000那么其反码还是 <code>0</code>000 0000 ;如果是 <code>-0</code>,对应的原码是 <code>1</code>000 0000其反码是 <code>1</code>111 1111显然不符合实际情况所以计算机底层虽然存储和计算的都是二进数但显然不是反码。</p></div><h3 id="_3-5-4-补码" tabindex="-1">3.5.4 补码 <a class="header-anchor" href="#_3-5-4-补码" aria-label="Permalink to &quot;3.5.4 补码&quot;"></a></h3><ul><li><p>规则:</p><ul><li>正数的补码和它的原码相同。</li><li>负数的补码是在其反码的基础上 + 1 。</li></ul></li><li><p>+1 的补码,使用 8 位二进数来表示,就是:</p></li></ul><table tabindex="0"><thead><tr><th>十进制数</th><th>原码8位二进制数</th><th>反码8位二进制数</th><th>补码8位二进制数</th></tr></thead><tbody><tr><td>+1</td><td><code>0</code>000 0001</td><td><code>0</code>000 0001</td><td><code>0</code>000 0001</td></tr></tbody></table><ul><li>-1 的补码,使用 8 位二进数来表示,就是:</li></ul><table tabindex="0"><thead><tr><th>十进制数</th><th>原码8位二进制数</th><th>反码8位二进制数</th><th>补码8位二进制数</th></tr></thead><tbody><tr><td>-1</td><td><code>1</code>000 0001</td><td><code>1</code>111 1110</td><td><code>1</code>111 1111</td></tr></tbody></table><ul><li>如果 0 ,按照 <code>+0</code> 的情况进行处理,即:</li></ul><p><img src="/c/assets/29.COIOzcmT.png" alt=""></p><ul><li>如果 0 ,按照 <code>-0</code> 的情况进行处理,即:</li></ul><p><img src="/c/assets/30.Cu__mjav.png" alt=""></p><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li>① 补码表示法解决了<code>原码</code><code>反码</code>存在的<code>两种</code>零(<code>+0</code><code>-0</code>)的问题,即:在补码表示法中,只有<code>一个</code>零,即 0000 0000。</li><li>②补码使得<code>加法运算</code><code>减法运算</code>可以统一处理,通过将减法运算<code>转换</code>为加法运算,可以简化硬件设计,提高了运算效率。</li><li>③ 计算机底层<code>存储</code><code>计算</code>的都是<code>二进数的补码</code></li></ul></div><h3 id="_3-5-5-总结" tabindex="-1">3.5.5 总结 <a class="header-anchor" href="#_3-5-5-总结" aria-label="Permalink to &quot;3.5.5 总结&quot;"></a></h3><ul><li>① 正数的原码、反码和补码都是一样的,三码合一。</li><li>② 负数的反码是在其原码的基础上按位取反0 变 1 1 变 0 ),符号位不变;负数的补码是其反码 + 1 。</li><li>③ 0 的补码是 0 。</li></ul><h2 id="_3-6-计算机底层为什么使用补码" tabindex="-1">3.6 计算机底层为什么使用补码? <a class="header-anchor" href="#_3-6-计算机底层为什么使用补码" aria-label="Permalink to &quot;3.6 计算机底层为什么使用补码?&quot;"></a></h2><ul><li>如果计算是 <code>2 - 2</code> ,那么可以转换为 <code>2 + (-2)</code>,这样计算机内部在处理<code>减法计算</code>的时候,就会将其转换为<code>加法计算</code>的形式,以简化硬件设计和提高计算效率。</li><li><code>最高位</code>表示<code>符号位</code>,由于符号位的存在,如果使用<code>原码</code>来计算,就会导致<code>计算结果不正确</code>,即:</li></ul><p><img src="/c/assets/31.BX_KzkHt.png" alt=""></p><ul><li><code>补码</code>的设计可以巧妙的让<code>符号位</code>也参与计算,并且可以得到<code>正确的计算结果</code>,即:</li></ul><p><img src="/c/assets/32.COt_QxSP.png" alt=""></p></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><div class="edit-info" data-v-e257564d><!----><div class="last-updated" data-v-e257564d><p class="VPLastUpdated" data-v-e257564d data-v-e98dd255>上次更新: <time datetime="2024-08-11T04:50:40.000Z" data-v-e98dd255></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><a class="VPLink link pager-link prev" href="/c/notes/01_c-basic/01_xdx/" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>上一篇</span><span class="title" data-v-e257564d>C 语言入门</span><!--]--></a></div><div class="pager" data-v-e257564d><a class="VPLink link pager-link next" href="/c/notes/01_c-basic/03_xdx/" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>下一篇</span><span class="title" data-v-e257564d>数据类型和运算符</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-5d98c3a5 data-v-e315a0ad><div class="container" data-v-e315a0ad><p class="message" data-v-e315a0ad>Released under the MIT License.</p><p class="copyright" data-v-e315a0ad>Copyright © 2024 许大仙</p></div></footer><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DynzO91I\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DEs09TjE\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
</body>
</html>

View File

@ -8,9 +8,9 @@
<meta name="generator" content="VitePress v1.3.2">
<link rel="preload stylesheet" href="/c/assets/style.8enJ9bsK.css" as="style">
<script type="module" src="/c/assets/app.DS7FIVmo.js"></script>
<script type="module" src="/c/assets/app.DOv65PSF.js"></script>
<link rel="preload" href="/c/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
<link rel="modulepreload" href="/c/assets/chunks/theme.BqwVBBaA.js">
<link rel="modulepreload" href="/c/assets/chunks/theme.CfoaGUmH.js">
<link rel="modulepreload" href="/c/assets/chunks/framework.CZRoMP2i.js">
<link rel="modulepreload" href="/c/assets/notes_01_c-basic_03_xdx_index.md.lC6l29W7.lean.js">
<link rel="shortcut icon" href="/c//logo.svg">
@ -789,7 +789,7 @@
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div><h2 id="_2-8-运算符优先级" tabindex="-1">2.8 运算符优先级 <a class="header-anchor" href="#_2-8-运算符优先级" aria-label="Permalink to &quot;2.8 运算符优先级&quot;"></a></h2><ul><li>C 语言中运算符的优先级,如下所示:</li></ul><table tabindex="0"><thead><tr><th><strong>优先级</strong></th><th><strong>运算符</strong></th><th><strong>名称或含义</strong></th><th><strong>结合方向</strong></th></tr></thead><tbody><tr><td><strong>1</strong></td><td><code>[]</code></td><td>数组下标</td><td>➡️(从左到右)</td></tr><tr><td></td><td><code>()</code></td><td>圆括号</td><td></td></tr><tr><td></td><td><code>.</code></td><td>成员选择(对象)</td><td></td></tr><tr><td></td><td><code>-&gt;</code></td><td>成员选择(指针)</td><td></td></tr><tr><td><strong>2</strong></td><td><code>-</code></td><td>负号运算符</td><td>⬅️(从右到左)</td></tr><tr><td></td><td><code>(类型)</code></td><td>强制类型转换</td><td></td></tr><tr><td></td><td><code>++</code></td><td>自增运算符</td><td></td></tr><tr><td></td><td><code>--</code></td><td>自减运算符</td><td></td></tr><tr><td></td><td><code>*</code></td><td>取值运算符</td><td></td></tr><tr><td></td><td><code>&amp;</code></td><td>取地址运算符</td><td></td></tr><tr><td></td><td><code>!</code></td><td>逻辑非运算符</td><td></td></tr><tr><td></td><td><code>~</code></td><td>按位取反运算符</td><td></td></tr><tr><td></td><td><code>sizeof</code></td><td>长度运算符</td><td></td></tr><tr><td><strong>3</strong></td><td><code>/</code></td><td></td><td>➡️(从左到右)</td></tr><tr><td></td><td><code>*</code></td><td></td><td></td></tr><tr><td></td><td><code>%</code></td><td>余数(取模)</td><td></td></tr><tr><td><strong>4</strong></td><td><code>+</code></td><td></td><td>➡️(从左到右)</td></tr><tr><td></td><td><code>-</code></td><td></td><td></td></tr><tr><td><strong>5</strong></td><td><code>&lt;&lt;</code></td><td>左移</td><td>➡️(从左到右)</td></tr><tr><td></td><td><code>&gt;&gt;</code></td><td>右移</td><td></td></tr><tr><td><strong>6</strong></td><td><code>&gt;</code></td><td>大于</td><td>➡️(从左到右)</td></tr><tr><td></td><td><code>&gt;=</code></td><td>大于等于</td><td></td></tr><tr><td></td><td><code>&lt;</code></td><td>小于</td><td></td></tr><tr><td></td><td><code>&lt;=</code></td><td>小于等于</td><td></td></tr><tr><td><strong>7</strong></td><td><code>==</code></td><td>等于</td><td>➡️(从左到右)</td></tr><tr><td></td><td><code>!=</code></td><td>不等于</td><td></td></tr><tr><td><strong>8</strong></td><td><code>&amp;</code></td><td>按位与</td><td>➡️(从左到右)</td></tr><tr><td><strong>9</strong></td><td><code>^</code></td><td>按位异或</td><td>➡️(从左到右)</td></tr><tr><td><strong>10</strong></td><td><code>|</code></td><td>按位或</td><td>➡️(从左到右)</td></tr><tr><td><strong>11</strong></td><td><code>&amp;&amp;</code></td><td>逻辑与</td><td>➡️(从左到右)</td></tr><tr><td><strong>12</strong></td><td><code>||</code></td><td>逻辑或</td><td>➡️(从左到右)</td></tr><tr><td><strong>13</strong></td><td><code>?:</code></td><td>条件运算符</td><td>⬅️(从右到左)</td></tr><tr><td><strong>14</strong></td><td><code>=</code></td><td>赋值运算符</td><td>⬅️(从右到左)</td></tr><tr><td></td><td><code>/=</code></td><td>除后赋值</td><td></td></tr><tr><td></td><td><code>*=</code></td><td>乘后赋值</td><td></td></tr><tr><td></td><td><code>%=</code></td><td>取模后赋值</td><td></td></tr><tr><td></td><td><code>+=</code></td><td>加后赋值</td><td></td></tr><tr><td></td><td><code>-=</code></td><td>减后赋值</td><td></td></tr><tr><td></td><td><code>&lt;&lt;=</code></td><td>左移后赋值</td><td></td></tr><tr><td></td><td><code>&gt;&gt;=</code></td><td>右移后赋值</td><td></td></tr><tr><td></td><td><code>&amp;=</code></td><td>按位与后赋值</td><td></td></tr><tr><td></td><td><code>^=</code></td><td>按位异或后赋值</td><td></td></tr><tr><td></td><td><code>|=</code></td><td>按位或后赋值</td><td></td></tr><tr><td><strong>15</strong></td><td><code>,</code></td><td>逗号运算符</td><td>➡️(从左到右)</td></tr></tbody></table><div class="warning custom-block github-alert"><p class="custom-block-title">WARNING</p><p></p><ul><li>① 不要过多的依赖运算符的优先级来控制表达式的执行顺序,这样可读性太差,尽量<code>使用小括号来控制</code>表达式的执行顺序。</li><li>② 不要把一个表达式写得过于复杂,如果一个表达式过于复杂,则把它<code>分成几步</code>来完成。</li><li>③ 运算符优先级不用刻意地去记忆,总体上:一元运算符 &gt; 算术运算符 &gt; 关系运算符 &gt; 逻辑运算符 &gt; 三元运算符 &gt; 赋值运算符。</li></ul></div><h1 id="第三章-附录" tabindex="-1">第三章:附录 <a class="header-anchor" href="#第三章-附录" aria-label="Permalink to &quot;第三章:附录&quot;"></a></h1><h2 id="_3-1-字符集和字符集编码" tabindex="-1">3.1 字符集和字符集编码 <a class="header-anchor" href="#_3-1-字符集和字符集编码" aria-label="Permalink to &quot;3.1 字符集和字符集编码&quot;"></a></h2><h3 id="_3-3-1-概述" tabindex="-1">3.3.1 概述 <a class="header-anchor" href="#_3-3-1-概述" aria-label="Permalink to &quot;3.3.1 概述&quot;"></a></h3><ul><li>字符集和字符集编码(简称编码)计算机系统中处理文本数据的两个基本概念,它们密切相关但又有区别。</li><li>字符集Character Set是一组字符的集合其中每个字符都被分配了一个<code>唯一的编号</code>(通常是数字)。字符可以是字母、数字、符号、控制代码(如换行符)等。<code>字符集定义了可以表示的字符的范围</code>,但它并不直接定义如何将这些字符存储在计算机中。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>ASCII美国信息交换标准代码是最早期和最简单的字符集之一它只包括了英文字母、数字和一些特殊字符共 128 个字符。每个字符都分配给了一个从 0 到 127 的数字。</p></div><ul><li>字符集编码Character Encoding简称编码是一种方案或方法<code>它定义了如何将字符集中的字符转换为计算机存储和传输的数据(通常是一串二进制数字)</code>。简而言之,编码是字符到二进制数据之间的映射规则。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>ASCII 编码方案定义了如何将 ASCII 字符集中的每个字符表示为 7 位的二进制数字。例如:大写字母<code>&#39;A&#39;</code>在 ASCII 编码中表示为二进制的<code>1000001</code>,十进制的 <code>65</code></p></div><ul><li><code>字符集</code><code>字符集编码</code>之间的关系如下:</li></ul><p><img src="/c/assets/29.CGTVELeO.png" alt=""></p><ul><li>Linux 中安装帮助手册:</li></ul><p><img src="/c/assets/30.Bz4_lEH0.gif" alt=""></p><h3 id="_3-3-2-ascii-编码" tabindex="-1">3.3.2 ASCII 编码 <a class="header-anchor" href="#_3-3-2-ascii-编码" aria-label="Permalink to &quot;3.3.2 ASCII 编码&quot;"></a></h3><ul><li><code>冯·诺依曼</code>体系结构中,我们知道,计算机中所有的<code>数据</code><code>指令</code>都是以<code>二进制</code>的形式表示的;所以,计算机中对于文本数据的数据也是以二进制来存储的,那么对应的流程如下:</li></ul><p><img src="/c/assets/31.CcDWE4nn.png" alt=""></p><ul><li>我们知道,计算机是上个世纪 60 年代在美国研制成功的,为了实现字符和二进制的转换,美国就制定了一套字符编码,即英语字符和二进制位之间的关系,即 ASCII American Standard Code for Information Interchange编码 <ul><li>ASCII 编码只包括了英文字符、数字和一些特殊字符,一共 128 个字符,并且每个字符都分配了唯一的数字,范围是 0 - 127。</li><li>ASCII 编码中的每个字符都使用 7 位的二进制数字表示;但是,计算机中的存储的最小单位是 1 B = 8 位,那么最高位统一规定为 0 。</li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 其实,早期是没有字符集的概念的,只是后来为了解决乱码问题,而产生了字符集的概念。</li><li>② 对于英文体系来说,<code>a-zA-Z0-9</code>以及一些<code>特殊字符</code>一共 <code>128</code> 就可以满足实际存储需求;所以,在也是为什么 ASCII 码使用 7 位二进制2^7 = 128 )来存储的。</li></ul></div><ul><li>在操作系统中就内置了对应的编码表Linux 也不例外;可以使用如下的命令查看:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">man</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ascii</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/32.B7y2_JVX.gif" alt=""></p><ul><li>其对应的 ASCII 编码表,如下所示:</li></ul><p><img src="/c/assets/33.Btcc3rs2.gif" alt=""></p><ul><li>但是,随着计算机的发展,计算机开始了东征之路,由美国传播到东方:</li></ul><p><img src="/c/assets/34.CR4ARW8y.png" alt=""></p><ul><li>先是传播到了欧洲,欧洲在兼容 ASCII 编码的基础上,推出了 ISO8859-1 编码,即: <ul><li>ISO8859-1 编码包括基本的拉丁字母表、数字、标点符号,以及西欧语言中特有的一些字符,如:法语中的 <code>è</code>、德语中的 <code>ü</code> 等。</li><li>ISO 8859-1 为每个字符分配一个单字节8 位)编码,意味着它可以表示最多 256 2^8个不同的字符编号从 0 到 255</li><li>ISO 8859-1 的前 128 个字符与 ASCII 编码完全一致,这使得 ASCII 编码的文本可以无缝转换为 ISO 8859-1 编码。</li></ul></li></ul><p><img src="/c/assets/33.Btcc3rs2.gif" alt=""></p><p><img src="/c/assets/36.DOX3ymYP.gif" alt=""></p><ul><li>计算机继续传播到了亚洲,亚洲(双字节)各个国家分别给出了自己国家对应的字符集编码,如: <ul><li>日本推出了 Shift-JIS 编码: <ul><li>单字节 ASCII 范围0 - 127。</li><li>双字节范围: <ul><li>第一个字节129 - 159 和 224 - 239 。</li><li>第二个字节64 - 126 和 128 - 252 。</li></ul></li></ul></li><li>韩国推出了 EUC-KR 编码: <ul><li>单字节 ASCII 范围0 - 127。</li><li>双字节范围:从 41281 - 65278。</li></ul></li><li>中国推出了 GBK 编码: <ul><li>单字节 ASCII 范围0 - 127。</li><li>双字节范围33088 - 65278 。</li></ul></li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 通过上面日本、韩国、中国的编码十进制范围,我们可以看到,虽然这些编码系统在技术上的编码范围存在重叠(特别是在高位字节区域),但因为它们各自支持的字符集完全不同,所以实际上它们并不直接冲突。</li><li>② 但是,如果一个中国人通过 GBK 编码写的文章,通过邮件发送给韩国人,因为韩国和中国在字符集编码上的高位字节有重叠部分,必然会造成歧义。</li></ul></div><h3 id="_3-3-3-unicode-编码" tabindex="-1">3.3.3 Unicode 编码 <a class="header-anchor" href="#_3-3-3-unicode-编码" aria-label="Permalink to &quot;3.3.3 Unicode 编码&quot;"></a></h3><ul><li><p>在 Unicode 之前世界上存在着数百种不同的编码系统每一种编码系统都是为了支持特定语言或一组语言的字符集。这些编码系统包括ASCII、ISO 8859 系列、GBK、Shift-JIS、EUC-KR 等,它们各自有不同的字符范围和编码方式。这种多样性虽然在局部范围内解决了字符表示的问题,但也带来了以下几个方面的挑战:</p><ul><li><code>编码冲突</code>:由于不同的编码系统可以为相同的字节值分配不同的字符,因此在不同编码之间转换文本时,如果没有正确处理编码信息,就很容易产生乱码。这种编码冲突在尝试处理多种语言的文本时尤为突出。</li><li><code>编码的复杂性</code>:随着全球化的发展,软件和系统需要支持越来越多的语言,这就要求开发者和系统同时处理多种不同的编码系统。这不仅增加了开发和维护的复杂性,而且也增加了出错的风险。</li><li><code>资源限制</code>:在早期计算机技术中,内存和存储资源相对有限。不同的编码标准要求系统存储多套字符集数据,这无疑增加了对有限资源的消耗。</li><li>……</li></ul></li><li><p>针对上述的种种问题为了推行全球化Unicode 应运而生Unicode 的核心规则和设计原则是建立一个全球统一的字符集,使得世界上所有的文字和符号都能被唯一地识别和使用,无论使用者位于何地或使用何种语言。这套规则包括了字符的编码、表示、处理和转换机制,旨在确保不同系统和软件间能够无缝交换和处理文本数据。</p><ul><li><code>通用字符集 (UCS)</code>Unicode 为每一个字符分配一个唯一的编号(称为<code>“码点”</code>)。这些码点被组织在一个统一的字符集中,官方称之为 “通用字符集”Universal Character SetUCS。码点通常表示为 <code>U+</code> 后跟一个十六进制数,例如:<code>U+0041</code> 代表大写的英文字母 <code>“A”</code></li><li><code>编码平面和区段</code>Unicode 码点被划分为多个 “平面Planes每个平面包含 6553616^4个码点。目前Unicode定义了 17 个平面(从 0 到16每个平面被分配了一个编号从 “基本多文种平面BMP” 的 0 开始,到 16 号平面结束。这意味着 Unicode 理论上可以支持超过 110万17*65536个码点。</li></ul></li><li><p>Unicode 仅仅只是字符集,给每个字符设置了唯一的数字编号而已,却没有给出这些数字编号实际如何存储,可以通过如下命令查看:</p></li></ul><p><img src="/c/assets/37.Cie9_tkP.gif" alt=""></p><ul><li>为了在计算机系统中表示 Unicode 字符,定义了几种编码方案,这些方案包括 UTF-8、UTF-16 和 UTF-32 等。 <ul><li><strong>UTF-8</strong>:使用 1 - 4 个字节表示每个 Unicode 字符,兼容 ASCII是网络上最常用的编码。</li><li><strong>UTF-16</strong>:使用 2 - 4 个字节表示每个 Unicode 字符,适合于需要经常处理基本多文种平面之外字符的应用。</li><li><strong>UTF-32</strong>:使用固定的 4 个字节表示每个 Unicode 字符,简化了字符处理,但增加了存储空间的需求。</li></ul></li><li><code>Unicode 字符集</code>和对应的<code>UTF-8 字符编码</code>之间的关系,如下所示:</li></ul><p><img src="/c/assets/38.DLjH9Ges.png" alt=""></p></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><div class="edit-info" data-v-e257564d><!----><div class="last-updated" data-v-e257564d><p class="VPLastUpdated" data-v-e257564d data-v-e98dd255>上次更新: <time datetime="2024-08-05T06:43:51.000Z" data-v-e98dd255></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><a class="VPLink link pager-link prev" href="/c/notes/01_c-basic/02_xdx/" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>上一篇</span><span class="title" data-v-e257564d>变量和进制</span><!--]--></a></div><div class="pager" data-v-e257564d><a class="VPLink link pager-link next" href="/c/notes/01_c-basic/04_xdx/" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>下一篇</span><span class="title" data-v-e257564d>流程控制</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-5d98c3a5 data-v-e315a0ad><div class="container" data-v-e315a0ad><p class="message" data-v-e315a0ad>Released under the MIT License.</p><p class="copyright" data-v-e315a0ad>Copyright © 2024 许大仙</p></div></footer><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DynzO91I\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DEs09TjE\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
</body>
</html>

View File

@ -8,9 +8,9 @@
<meta name="generator" content="VitePress v1.3.2">
<link rel="preload stylesheet" href="/c/assets/style.8enJ9bsK.css" as="style">
<script type="module" src="/c/assets/app.DS7FIVmo.js"></script>
<script type="module" src="/c/assets/app.DOv65PSF.js"></script>
<link rel="preload" href="/c/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
<link rel="modulepreload" href="/c/assets/chunks/theme.BqwVBBaA.js">
<link rel="modulepreload" href="/c/assets/chunks/theme.CfoaGUmH.js">
<link rel="modulepreload" href="/c/assets/chunks/framework.CZRoMP2i.js">
<link rel="modulepreload" href="/c/assets/notes_01_c-basic_04_xdx_index.md.DkXfRsso.lean.js">
<link rel="shortcut icon" href="/c//logo.svg">
@ -772,7 +772,7 @@
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br></div></div></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><div class="edit-info" data-v-e257564d><!----><div class="last-updated" data-v-e257564d><p class="VPLastUpdated" data-v-e257564d data-v-e98dd255>上次更新: <time datetime="2024-08-06T08:32:38.000Z" data-v-e98dd255></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><a class="VPLink link pager-link prev" href="/c/notes/01_c-basic/03_xdx/" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>上一篇</span><span class="title" data-v-e257564d>数据类型和运算符</span><!--]--></a></div><div class="pager" data-v-e257564d><a class="VPLink link pager-link next" href="/c/notes/01_c-basic/05_xdx/" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>下一篇</span><span class="title" data-v-e257564d>数组</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-5d98c3a5 data-v-e315a0ad><div class="container" data-v-e315a0ad><p class="message" data-v-e315a0ad>Released under the MIT License.</p><p class="copyright" data-v-e315a0ad>Copyright © 2024 许大仙</p></div></footer><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DynzO91I\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DEs09TjE\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
</body>
</html>

View File

@ -8,9 +8,9 @@
<meta name="generator" content="VitePress v1.3.2">
<link rel="preload stylesheet" href="/c/assets/style.8enJ9bsK.css" as="style">
<script type="module" src="/c/assets/app.DS7FIVmo.js"></script>
<script type="module" src="/c/assets/app.DOv65PSF.js"></script>
<link rel="preload" href="/c/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
<link rel="modulepreload" href="/c/assets/chunks/theme.BqwVBBaA.js">
<link rel="modulepreload" href="/c/assets/chunks/theme.CfoaGUmH.js">
<link rel="modulepreload" href="/c/assets/chunks/framework.CZRoMP2i.js">
<link rel="modulepreload" href="/c/assets/notes_01_c-basic_05_xdx_index.md.Dzk0jyse.lean.js">
<link rel="shortcut icon" href="/c//logo.svg">
@ -720,7 +720,7 @@
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br></div></div><div class="warning custom-block github-alert"><p class="custom-block-title">WARNING</p><p></p><p>在上述示例中,<code>arr</code><code>&amp;arr</code> 的值是一样的,但是对应的含义是不同的。</p><ul><li><code>arr</code> 是数组名,在大多数情况下会转换为数组第一个元素的地址,即:<code>arr</code> 等价于 <code>&amp;arr[0]</code>,其数据类型是 <code>int *</code></li><li><code>&amp;arr</code>是数组名的地址,即整个数组的地址,它指向数组本身,并不是数组第一个元素的地址,<code>&amp;arr</code> 的数据类型是 <code>int(*)[3]</code></li></ul></div></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><div class="edit-info" data-v-e257564d><!----><div class="last-updated" data-v-e257564d><p class="VPLastUpdated" data-v-e257564d data-v-e98dd255>上次更新: <time datetime="2024-08-10T23:48:27.000Z" data-v-e98dd255></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><a class="VPLink link pager-link prev" href="/c/notes/01_c-basic/04_xdx/" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>上一篇</span><span class="title" data-v-e257564d>流程控制</span><!--]--></a></div><div class="pager" data-v-e257564d><a class="VPLink link pager-link next" href="/c/notes/01_c-basic/06_xdx/" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>下一篇</span><span class="title" data-v-e257564d>指针</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-5d98c3a5 data-v-e315a0ad><div class="container" data-v-e315a0ad><p class="message" data-v-e315a0ad>Released under the MIT License.</p><p class="copyright" data-v-e315a0ad>Copyright © 2024 许大仙</p></div></footer><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DynzO91I\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DEs09TjE\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
</body>
</html>

View File

@ -8,9 +8,9 @@
<meta name="generator" content="VitePress v1.3.2">
<link rel="preload stylesheet" href="/c/assets/style.8enJ9bsK.css" as="style">
<script type="module" src="/c/assets/app.DS7FIVmo.js"></script>
<script type="module" src="/c/assets/app.DOv65PSF.js"></script>
<link rel="preload" href="/c/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
<link rel="modulepreload" href="/c/assets/chunks/theme.BqwVBBaA.js">
<link rel="modulepreload" href="/c/assets/chunks/theme.CfoaGUmH.js">
<link rel="modulepreload" href="/c/assets/chunks/framework.CZRoMP2i.js">
<link rel="modulepreload" href="/c/assets/notes_01_c-basic_06_xdx_index.md.B8Z5KXti.lean.js">
<link rel="shortcut icon" href="/c//logo.svg">
@ -101,7 +101,7 @@
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Address of array: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%p\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&amp;</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">arr</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 返回整个数组的地址</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Address of pointer: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%p\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&amp;</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">ptr</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 返回指针变量ptr的地址</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div></li></ol><p>综上所述,通过这些示例和解释,可以看出数组名虽然在某些场合下可以像指针一样使用,但它并不是一个真正的指针变量,而是一个常量,表示数组的首地址。</p></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><div class="edit-info" data-v-e257564d><!----><div class="last-updated" data-v-e257564d><p class="VPLastUpdated" data-v-e257564d data-v-e98dd255>上次更新: <time datetime="2024-08-11T04:50:40.000Z" data-v-e98dd255></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><a class="VPLink link pager-link prev" href="/c/notes/01_c-basic/05_xdx/" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>上一篇</span><span class="title" data-v-e257564d>数组</span><!--]--></a></div><div class="pager" data-v-e257564d><a class="VPLink link pager-link next" href="/c/notes/01_c-basic/07_xdx/" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>下一篇</span><span class="title" data-v-e257564d>函数</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-5d98c3a5 data-v-e315a0ad><div class="container" data-v-e315a0ad><p class="message" data-v-e315a0ad>Released under the MIT License.</p><p class="copyright" data-v-e315a0ad>Copyright © 2024 许大仙</p></div></footer><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DynzO91I\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DEs09TjE\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
</body>
</html>

View File

@ -8,9 +8,9 @@
<meta name="generator" content="VitePress v1.3.2">
<link rel="preload stylesheet" href="/c/assets/style.8enJ9bsK.css" as="style">
<script type="module" src="/c/assets/app.DS7FIVmo.js"></script>
<script type="module" src="/c/assets/app.DOv65PSF.js"></script>
<link rel="preload" href="/c/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
<link rel="modulepreload" href="/c/assets/chunks/theme.BqwVBBaA.js">
<link rel="modulepreload" href="/c/assets/chunks/theme.CfoaGUmH.js">
<link rel="modulepreload" href="/c/assets/chunks/framework.CZRoMP2i.js">
<link rel="modulepreload" href="/c/assets/notes_04_linux_01_xdx_index.md.D7-UlHSH.lean.js">
<link rel="shortcut icon" href="/c//logo.svg">
@ -21,7 +21,7 @@
</head>
<body>
<div id="app"><div class="Layout" data-v-5d98c3a5><!--[--><!--]--><!--[--><span tabindex="-1" data-v-0f60ec36></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-0f60ec36> Skip to content </a><!--]--><!----><header class="VPNav" data-v-5d98c3a5 data-v-ae24b3ad><div class="VPNavBar has-sidebar top" data-v-ae24b3ad data-v-6aa21345><div class="wrapper" data-v-6aa21345><div class="container" data-v-6aa21345><div class="title" data-v-6aa21345><div class="VPNavBarTitle has-sidebar" data-v-6aa21345 data-v-ab179fa1><a class="title" href="/c/" data-v-ab179fa1><!--[--><!--]--><!--[--><img class="VPImage logo" src="/c/logo.svg" alt data-v-8426fc1a><!--]--><span data-v-ab179fa1>许大仙</span><!--[--><!--]--></a></div></div><div class="content" data-v-6aa21345><div class="content-body" data-v-6aa21345><!--[--><!--]--><div class="VPNavBarSearch search" data-v-6aa21345><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><span class="vp-icon DocSearch-Search-Icon"></span><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-6aa21345 data-v-dc692963><span id="main-nav-aria-label" class="visually-hidden" data-v-dc692963> Main Navigation </span><!--[--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/" target="_blank" rel="noreferrer" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>首页</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/coa6/notes/" target="_blank" rel="noreferrer" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>计组6件套</span><!--]--></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-dc692963 data-v-b6c34ac9><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-b6c34ac9><span class="text" data-v-b6c34ac9><!----><span data-v-b6c34ac9>编程语言</span><span class="vpi-chevron-down text-icon" data-v-b6c34ac9></span></span></button><div class="menu" data-v-b6c34ac9><div class="VPMenu" data-v-b6c34ac9 data-v-b98bc113><div class="items" data-v-b98bc113><!--[--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link" href="/c/notes/" data-v-43f1e123><!--[-->c/c++<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/web-design/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->前端<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/java/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->Java<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/big-data/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->大数据<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/linux/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->云原生<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/go/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->Go<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/python/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->Python<!--]--></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/open-software/notes/" target="_blank" rel="noreferrer" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>开源软件</span><!--]--></a><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-6aa21345 data-v-6c893767><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-6c893767 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-6aa21345 data-v-0394ad82 data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/Aurorxa" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-eee4e7cb><span class="vpi-social-github" /></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-6aa21345 data-v-bb2aa2f0 data-v-b6c34ac9><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-b6c34ac9><span class="vpi-more-horizontal icon" data-v-b6c34ac9></span></button><div class="menu" data-v-b6c34ac9><div class="VPMenu" data-v-b6c34ac9 data-v-b98bc113><!----><!--[--><!--[--><!----><div class="group" data-v-bb2aa2f0><div class="item appearance" data-v-bb2aa2f0><p class="label" data-v-bb2aa2f0>Appearance</p><div class="appearance-action" data-v-bb2aa2f0><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-bb2aa2f0 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div></div></div><div class="group" data-v-bb2aa2f0><div class="item social-links" data-v-bb2aa2f0><div class="VPSocialLinks social-links-list" data-v-bb2aa2f0 data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/Aurorxa" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-eee4e7cb><span class="vpi-social-github" /></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-6aa21345 data-v-e5dd9c1c><span class="container" data-v-e5dd9c1c><span class="top" data-v-e5dd9c1c></span><span class="middle" data-v-e5dd9c1c></span><span class="bottom" data-v-e5dd9c1c></span></span></button></div></div></div></div><div class="divider" data-v-6aa21345><div class="divider-line" data-v-6aa21345></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-5d98c3a5 data-v-a6f0e41e><div class="container" data-v-a6f0e41e><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-a6f0e41e><span class="vpi-align-left menu-icon" data-v-a6f0e41e></span><span class="menu-text" data-v-a6f0e41e>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-a6f0e41e data-v-17a5e62e><button data-v-17a5e62e>返回顶部</button><!----></div></div></div><aside class="VPSidebar" data-v-5d98c3a5 data-v-319d5ca6><div class="curtain" data-v-319d5ca6></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-319d5ca6><span class="visually-hidden" id="sidebar-aria-label" data-v-319d5ca6> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h2 class="text" data-v-b7550ba0>C 语言基础</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/00_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>编程基础</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>C 语言入门</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/02_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>变量和进制</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/03_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>数据类型和运算符</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/04_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>流程控制</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/05_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>数组</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/06_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>指针</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/07_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>函数</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/08_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>预处理器</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/09_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>自定义数据类型</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/10_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>字符串和时间</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/11_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>内存管理</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/12_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>文件操作</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/13_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>调试工具和调试技巧gdb和make</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/14_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>常用库函数</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h2 class="text" data-v-b7550ba0>C 语言高级</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>变量和内存分布</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/02_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>指针强化</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/03_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>结构体和文件的高级用法</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/04_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>链表和回调函数</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/05_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>编译过程和面向接口</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h2 class="text" data-v-b7550ba0>项目构建工具</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><section class="VPSidebarItem level-1 collapsible collapsed" data-v-b7550ba0 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h3 class="text" data-v-b7550ba0>meson</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-2 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/03_build/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Gradle 入门</p><!--]--></a><!----></div><!----></div><!--]--></div></section><section class="VPSidebarItem level-1 collapsible collapsed" data-v-b7550ba0 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h3 class="text" data-v-b7550ba0>cmake</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-2 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/03_build/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Gradle 入门</p><!--]--></a><!----></div><!----></div><!--]--></div></section><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/03_build/01_${commonDirectoryName}/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>conan </p><!--]--></a><!----></div><!----></div><section class="VPSidebarItem level-1 collapsible collapsed" data-v-b7550ba0 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h3 class="text" data-v-b7550ba0>Gradle</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-2 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/03_build/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Gradle 入门</p><!--]--></a><!----></div><!----></div><!--]--></div></section><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible has-active" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h2 class="text" data-v-b7550ba0>Linux</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/04_linux/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Linux 初识和安装</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><div class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><p class="text" data-v-b7550ba0>C++ 核心编程</p><!----></div><!----></div></div><div class="no-transition group" data-v-c40bc020><div class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><p class="text" data-v-b7550ba0>C++ 标准库</p><!----></div><!----></div></div><div class="no-transition group" data-v-c40bc020><div class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><p class="text" data-v-b7550ba0>QT 桌面开发</p><!----></div><!----></div></div><div class="no-transition group" data-v-c40bc020><div class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><p class="text" data-v-b7550ba0>Linux 高并发服务器开发</p><!----></div><!----></div></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-5d98c3a5 data-v-1428d186><div class="VPDoc has-sidebar has-aside" data-v-1428d186 data-v-39a288b8><!--[--><!--]--><div class="container" data-v-39a288b8><div class="aside" data-v-39a288b8><div class="aside-curtain" data-v-39a288b8></div><div class="aside-container" data-v-39a288b8><div class="aside-content" data-v-39a288b8><div class="VPDocAside" data-v-39a288b8 data-v-3f215769><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-3f215769 data-v-a5bbad30><div class="content" data-v-a5bbad30><div class="outline-marker" data-v-a5bbad30></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-a5bbad30>目录</div><ul class="VPDocOutlineItem root" data-v-a5bbad30 data-v-b933a997><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-3f215769></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-39a288b8><div class="content-container" data-v-39a288b8><!--[--><!--]--><main class="main" data-v-39a288b8><div style="position:relative;" class="vp-doc _c_notes_04_linux_01_xdx_" data-v-39a288b8><div><h1 id="第一章-linux" tabindex="-1">第一章Linux <a class="header-anchor" href="#第一章-linux" aria-label="Permalink to &quot;第一章Linux&quot;"></a></h1><h2 id="_1-1-linux-概述" tabindex="-1">1.1 Linux 概述 <a class="header-anchor" href="#_1-1-linux-概述" aria-label="Permalink to &quot;1.1 Linux 概述&quot;"></a></h2><ul><li>Linux 是一种开源的操作系统最初由芬兰的林纳斯·托瓦兹Linus Torvalds开发。它基于 UNIX 操作系统并且具有高度的可定制性和灵活性。Linux 操作系统被广泛应用于<code>服务器</code>、嵌入式系统和个人计算机等领域。</li><li>它具有稳定性、安全性和可靠性并且支持多用户、多任务和多线程。Linux 拥有众多的发行版Ubuntu、Red Hat、Debian 等,每个发行版都有自己的特点和优势。</li><li>由于其开源性质Linux 操作系统受到了全球开发者的广泛支持和贡献,成为了计算机行业中的重要组成部分。</li></ul><h2 id="_1-2-linux-的发展史" tabindex="-1">1.2 Linux 的发展史 <a class="header-anchor" href="#_1-2-linux-的发展史" aria-label="Permalink to &quot;1.2 Linux 的发展史&quot;"></a></h2><ul><li><p>Linux 的发展历史可以分为以下几个阶段:</p><ul><li>① 初始阶段1991 - 1994 年):林纳斯·托瓦兹在 1991 年发布了 Linux 内核的第一个版本并将其开源。在接下来的几年里Linux 逐渐吸引了一些开发者的关注和参与,开始逐步完善和扩展功能。</li><li>② 发展阶段1995 - 2000 年在这个阶段Linux 开始受到更多人的关注和认可。许多开发者和公司开始为 Linux 开发应用程序和驱动程序为其增加更多的功能和兼容性。同时一些发行版如Red Hat、Debian 等也开始出现,为用户提供了更方便的安装和使用方式。</li><li>③ 商业化阶段2001 - 至今):随着 Linux 的成熟和广泛应用,越来越多的公司开始将 Linux 作为服务器和嵌入式设备的操作系统。一些大型科技公司IBM、Oracle 等也开始投入大量资源支持 Linux 的发展。同时,一些商业化的 Linux 发行版SUSE、Ubuntu 等也崭露头角,为企业和个人用户提供了更专业的支持和服务。</li><li>④ 社区发展阶段Linux 的发展一直依赖于全球开发者社区的贡献和支持。Linux 社区不断壮大吸引了众多的开发者和爱好者参与其中。通过社区的力量Linux 不断更新迭代,推出了许多新的版本和功能。</li></ul></li><li><p>总的来说Linux 的发展历程是一个由个人项目逐渐发展为全球开源社区支持的过程。它的成功得益于开源模式的优势,以及全球开发者的共同努力和贡献。</p></li></ul><h2 id="_1-3-linux-的组成-⭐" tabindex="-1">1.3 Linux 的组成(⭐) <a class="header-anchor" href="#_1-3-linux-的组成-⭐" aria-label="Permalink to &quot;1.3 Linux 的组成(⭐)&quot;"></a></h2><ul><li><p>Linux 主要由以下几个组成部分构成:</p><ul><li><code>Linux 内核</code>Linux 内核是整个操作系统的核心,负责管理硬件设备、内存管理、进程调度等核心功能。它是由林纳斯·托瓦兹及其他开发者编写和维护的。</li><li><code>Shell 解释器</code>Shell 解释器是用户与操作系统交互的接口,它接收用户输入的命令并将其解释执行。常见的 Shell 解释器有 Bash、Zsh 等,它们提供了命令行界面和脚本编程功能。</li><li><code>外围的应用程序</code>:命令、应用程序、图形化界面……</li></ul></li><li><p>其图示如下:</p></li></ul><p><img src="/c/assets/1.CC6XCSyT.png" alt="image-20240115214505877"></p><ul><li>上述的组成部分共同构成了一个完整的 Linux 操作系统,为用户提供了丰富的功能和灵活性。</li></ul><h2 id="_1-4-linux-发行版本-⭐" tabindex="-1">1.4 Linux 发行版本(⭐) <a class="header-anchor" href="#_1-4-linux-发行版本-⭐" aria-label="Permalink to &quot;1.4 Linux 发行版本(⭐)&quot;"></a></h2><ul><li>Linux <code>发行版本</code>就是:<code>Linux 内核</code> + <code>命令解释器</code> + <code>应用程序(桌面)</code></li><li>主流的 Linux 发行版本如下:</li></ul><table tabindex="0"><thead><tr><th>Linux 系统类别</th><th>Linux 系统</th><th>备注</th></tr></thead><tbody><tr><td>Debian 系列</td><td><code>Debian</code></td><td>更新频率较低,较为稳定和安全,可以用于企业生产环境。</td></tr><tr><td></td><td><code>Ubuntu</code></td><td>桌面美观,使用方便,开发使用。有桌面版和企业版本(服务器版本)。</td></tr><tr><td>Redhat 系列</td><td>RedHat Enterprise Linux<code>RHEL</code></td><td>红帽企业版本</td></tr><tr><td></td><td>CentOS</td><td>基于 Red Hat Enterprise LinuxRHEL源代码构建的免费开源操作系统。它提供了企业级的稳定性和安全性广泛用于服务器环境。</td></tr><tr><td></td><td>Fedora</td><td>Fedora 是由 Red Hat 赞助的社区驱动的 Linux 发行版,注重最新的软件和技术。它提供了一个先进的桌面环境和开发者工具。</td></tr><tr><td></td><td><code>Rocky Linux</code></td><td>用来替代 CentOS 系统的,也是基于 Red Hat Enterprise LinuxRHEL源代码构建的免费开源操作系统。</td></tr><tr><td></td><td><code>Alma Linux</code></td><td>用来替代 CentOS 系统的,也是基于 Red Hat Enterprise LinuxRHEL源代码构建的免费开源操作系统。</td></tr><tr><td>其它系列</td><td>SUSE、OpenSUSE</td><td>OpenSUSE 是一个用户友好且功能强大的 Linux 发行版,具有稳定性和灵活性。它提供了多种桌面环境和服务器选项。</td></tr></tbody></table><ul><li>当然,除了以上几个主流的 Linux 发行版还有许多其他的发行版Arch Linux、Gentoo、Mageia 等,它们各自有着不同的特点和适用场景。</li><li>选择适合自己需求的发行版是根据个人或组织的需求和偏好来决定的。</li></ul><h2 id="_1-5-linux-版本选择-⭐" tabindex="-1">1.5 Linux 版本选择(⭐) <a class="header-anchor" href="#_1-5-linux-版本选择-⭐" aria-label="Permalink to &quot;1.5 Linux 版本选择(⭐)&quot;"></a></h2><ul><li>推荐选择 <code>LTS 版</code><code>稳定版</code></li></ul><div class="warning custom-block github-alert"><p class="custom-block-title">WARNING</p><p></p><ul><li>LTS 是 <code>&quot;Long-Term Support&quot;</code> 的缩写意为长期支持。在软件开发领域LTS 通常用来描述某个版本或发行版的长期支持周期。</li><li>对于 Linux 发行版或其他软件LTS 版本通常会提供更长时间的支持和维护,以确保稳定性和安全性。这意味着在 LTS 版本的支持周期内,开发者会持续提供安全补丁、错误修复和其他重要更新,以保持系统的稳定性和可靠性。</li><li>LTS 版本通常适用于企业和组织等需要长期稳定性和可靠性的环境。相比于非 LTS 版本LTS 版本的更新频率较低,更注重于提供长期支持和维护。</li></ul></div><ul><li>本次选择:</li></ul><table tabindex="0"><thead><tr><th>系统版本</th><th>说明</th></tr></thead><tbody><tr><td><a href="https://cn.ubuntu.com/" target="_blank" rel="noreferrer">Ubuntu</a></td><td>LTS 18.04 、LTS 20.04 等</td></tr><tr><td><a href="https://almalinux.org/zh-hans/get-almalinux/" target="_blank" rel="noreferrer">AlmaLinux</a></td><td>9.1、9.2、9.3 等</td></tr></tbody></table><h1 id="第二章-工作和学习环境部署-⭐" tabindex="-1">第二章:工作和学习环境部署(⭐) <a class="header-anchor" href="#第二章-工作和学习环境部署-⭐" aria-label="Permalink to &quot;第二章:工作和学习环境部署(⭐)&quot;"></a></h1><h2 id="_2-1-服务器" tabindex="-1">2.1 服务器 <a class="header-anchor" href="#_2-1-服务器" aria-label="Permalink to &quot;2.1 服务器&quot;"></a></h2><ul><li><code>服务器</code>是一种专门用于提供服务的计算机系统。它通常具有更高的性能、可靠性和稳定性,以满足处理大量请求和提供持续服务的需求。</li><li><code>服务器</code>的主要功能是接收来自客户端的请求,并提供相应的服务或资源。这些服务可以包括:网站托管、数据库管理、文件存储、电子邮件、应用程序运行等。服务器通过网络与客户端进行通信,处理请求并返回相应的数据或结果。</li><li><code>服务器</code>通常采用高性能的硬件配置,如:多核处理器、大容量内存、高速存储设备等,以确保能够处理大量的并发请求。它们还通常具有冗余的设计,包括冗余电源、冗余网络连接和冗余存储等,以提高可靠性和可用性。</li><li><code>服务器</code>可以是物理服务器,即实际的硬件设备,也可以是虚拟服务器,即在物理服务器上通过虚拟化技术创建的虚拟机。无论是物理服务器还是虚拟服务器,它们都扮演着提供服务和资源的角色。</li><li>在企业和组织中,<code>服务器</code>通常由专门的 IT 团队进行管理和维护。他们负责服务器的配置、安全性、性能优化、备份和恢复等工作,以确保服务器的稳定运行和数据的安全性。</li></ul><div class="tip custom-block github-alert"><p class="custom-block-title">TIP</p><p></p><p>实际工作的时候,<code>Linux</code> 系统会运行在<code>服务器</code>上。</p></div><h2 id="_2-2-虚拟机概述" tabindex="-1">2.2 虚拟机概述 <a class="header-anchor" href="#_2-2-虚拟机概述" aria-label="Permalink to &quot;2.2 虚拟机概述&quot;"></a></h2><ul><li>虚拟机Virtual Machine简称 VM是一种软件实现的<code>计算机系统</code>,它在物理计算机上<code>模拟</code>出一个<code>完整的计算环境</code>。虚拟机可以在同一台物理计算机上同时运行多个独立的操作系统和应用程序。</li></ul><p><img src="/c/assets/2.CwBlEclN.png" alt="2"></p><ul><li>虚拟机的工作原理是通过<code>虚拟化技术</code>将物理计算机的硬件资源(如:处理器、内存、存储等)进行抽象和分配,为每个虚拟机提供一部分资源。每个虚拟机都被视为一个独立的计算机系统,可以运行自己的操作系统和应用程序。</li><li>虚拟机的优势在于它可以提供<code>隔离性</code><code>灵活性</code>。通过虚拟机,可以在同一台物理计算机上同时运行多个操作系统,实现资源的共享和最大化利用。同时,虚拟机还可以提供快速部署、快速备份和恢复等功能,方便管理和维护。</li><li>常见的虚拟机软件,包括:<code>VMware</code>、VirtualBox、KVM 等。它们提供了虚拟化平台和管理工具,使用户可以轻松创建、配置和管理虚拟机。虚拟机广泛应用于开发和测试环境、服务器虚拟化、云计算等领域。</li></ul><div class="warning custom-block github-alert"><p class="custom-block-title">WARNING</p><p></p><p><code>虚拟机软件</code><code>虚拟机</code>的概念不同:</p><ul><li><code>虚拟机软件</code>是用来模拟硬件一个<code>软件</code>VMware 等。</li><li>② 而<code>虚拟机</code>是通过虚拟机软件模拟出来的<code>计算机硬件</code>,其实是文件的集合,相当于一台没有安装 Windows 操作系统的<code>裸机</code></li><li>③ 在现实交谈的时候,我们有时候会模糊<code>虚拟机软件</code><code>虚拟机</code>的概念,甚至会使用<code>虚拟机</code>来代替<code>虚拟机软件</code>;此时,就需要根据<code>上下文环境(语境)</code>来判断到底说的是<code>虚拟机软件</code>还是<code>虚拟机</code>了。</li></ul></div><h2 id="_2-3-安装虚拟机软件" tabindex="-1">2.3 安装虚拟机软件 <a class="header-anchor" href="#_2-3-安装虚拟机软件" aria-label="Permalink to &quot;2.3 安装虚拟机软件&quot;"></a></h2><h3 id="_2-3-1-前提条件" tabindex="-1">2.3.1 前提条件 <a class="header-anchor" href="#_2-3-1-前提条件" aria-label="Permalink to &quot;2.3.1 前提条件&quot;"></a></h3><ul><li>需要在 BIOS 中开启<code>虚拟化</code>功能。</li></ul><p><img src="/c/assets/3.J5F_cBhK.png" alt="image-20240117085245337"></p><h3 id="_2-3-2-安装步骤" tabindex="-1">2.3.2 安装步骤 <a class="header-anchor" href="#_2-3-2-安装步骤" aria-label="Permalink to &quot;2.3.2 安装步骤&quot;"></a></h3><ul><li>① 双击打开 VMware 安装程序 。</li></ul><p><img src="/c/assets/4.CAszmKOt.png" alt="双击打开VMware安装程序.png"></p><ul><li>② 进行下一步安装:</li></ul><p><img src="/c/assets/5.BQfGVEyZ.png" alt="VMware进行下一步安装.png"></p><ul><li>③ 同意许可协议,单击下一步:</li></ul><p><img src="/c/assets/6.CLrc9soN.png" alt="VMware同意许可协议单击下一步.png"></p><ul><li>④ 根据需要决定是否需要更改软件的安装位置(建议放置于除 C 盘以外任意盘符下):</li></ul><p><img src="/c/assets/7.DN8V10Y_.png" alt="VMware更改安装位置.png"></p><p><img src="/c/assets/8.D39YC8gl.png" alt="VMware更改安装位置成功.png"></p><ul><li>⑤ 更改成功后,单击确定,下一步继续安装:</li></ul><p><img src="/c/assets/9.17u_HlGd.png" alt="VMware更改成功后单击确定下一步继续安装.png"></p><ul><li>⑥ 用户体验设置,如下图所示,单击下一步继续安装:</li></ul><p><img src="/c/assets/10.ClTZ3WGc.png" alt="VMware用户体验设置如下图所示单击下一步继续安装.png"></p><ul><li>⑦ 快捷方式设置,单击下一步继续安装:</li></ul><p><img src="/c/assets/11.BEz_Ueiq.png" alt="VMware快捷方式设置单击下一步继续安装.png"></p><ul><li>⑧ 单击安装按钮:</li></ul><p><img src="/c/assets/12.BX5Yqj5T.png" alt="VMware单击安装按钮.png"></p><ul><li>⑨ VMware 输入许可证:</li></ul><p><img src="/c/assets/13.CXCdllxm.png" alt="VMware单击许可证.png"></p><p><img src="/c/assets/14.BVmXN0Tc.png" alt="VMware输入许可证.png"></p><ul><li>⑩ 安装结束后,单击完成按钮:</li></ul><p><img src="/c/assets/15.DAQyYfi-.png" alt="VMware安装结束后单击完成按钮.png"></p><ul><li>⑪ 检查虚拟机软件是否安装了虚拟网卡:</li></ul><p><img src="/c/assets/16.Gdhu77aY.png" alt="查看VMware安装的虚拟网卡.png"></p><p><img src="/c/assets/17.DsINmFjQ.png" alt="查看VMware安装的虚拟网卡1.png"></p><p><img src="/c/assets/18.BCiTOjnr.png" alt="查看VMware安装的虚拟网卡2.png"></p><h3 id="_2-3-2-配置网络" tabindex="-1">2.3.2 配置网络 <a class="header-anchor" href="#_2-3-2-配置网络" aria-label="Permalink to &quot;2.3.2 配置网络&quot;"></a></h3><ul><li>① 打开 VMware 虚拟机软件:</li></ul><p><img src="/c/assets/19.CUjVh_kW.png" alt="image-20240116202917529"></p><ul><li>② 编辑 → 虚拟网络编辑器:</li></ul><p><img src="/c/assets/20.N7tf9IgN.png" alt="image-20240116202955131"></p><ul><li>③ Vmnet8 → 更改设置:</li></ul><p><img src="/c/assets/21.CzUVXQR5.png" alt="image-20240116203207282"></p><ul><li>④ 更改子网 IP 地址为 <code>192.168.10.0</code> ,其目的是为了将 IP 固定。</li></ul><p><img src="/c/assets/22.BzU-TuNg.png" alt="image-20240116203357894"></p><ul><li>⑤ DHCP 设置:</li></ul><p><img src="/c/assets/23.Ct4XJ04a.png" alt="image-20240116203529749"></p><p><img src="/c/assets/24.BbQXeCz0.png" alt="image-20240116203627959"></p><ul><li>⑤ 通过 <code>cmd</code> ,输入 <code>ipconfig</code> 命令,查看是否配置成功:</li></ul><p><img src="/c/assets/25.DJbYcERe.gif" alt=""></p><h2 id="_2-4-创建虚拟机" tabindex="-1">2.4 创建虚拟机 <a class="header-anchor" href="#_2-4-创建虚拟机" aria-label="Permalink to &quot;2.4 创建虚拟机&quot;"></a></h2><h3 id="_2-4-1-概述" tabindex="-1">2.4.1 概述 <a class="header-anchor" href="#_2-4-1-概述" aria-label="Permalink to &quot;2.4.1 概述&quot;"></a></h3><ul><li>创建虚拟机,本质上就类似购买一台没有安装操作系统的<code>裸机</code></li></ul><h3 id="_2-4-2-创建虚拟机" tabindex="-1">2.4.2 创建虚拟机 <a class="header-anchor" href="#_2-4-2-创建虚拟机" aria-label="Permalink to &quot;2.4.2 创建虚拟机&quot;"></a></h3><ul><li>① 文件 → 新建虚拟机:</li></ul><p><img src="/c/assets/26.C1Uhi5h_.png" alt="image-20240117090352182"></p><ul><li>② 选择<code>自定义</code>类型的配置:</li></ul><p><img src="/c/assets/27.C6VtVWo9.png" alt="image-20240117090443216"></p><ul><li>③ 虚拟机硬件兼容性:下一步即可。</li></ul><p><img src="/c/assets/28.AcLxveS_.png" alt="image-20240117090529266"></p><ul><li>④ 选择<code>稍后安装操作系统</code></li></ul><p><img src="/c/assets/29.BRaVNbyO.png" alt="image-20240117090636337"></p><ul><li>⑤ 选择虚拟机将安装的操作系统:</li></ul><p><img src="/c/assets/30.6rXr5Pik.png" alt="image-20240117090805295"></p><ul><li>⑥ 设置虚拟机的<code>名称</code><code>安装位置</code></li></ul><p><img src="/c/assets/31.BwNS-NE0.png" alt="image-20240117090944676"></p><div class="warning custom-block github-alert"><p class="custom-block-title">WARNING</p><p></p><p>一个虚拟机一个安装目录(文件夹),防止引起文件的冲突。</p></div><ul><li>⑦ 虚拟机中处理器的配置:下一步即可。</li></ul><p><img src="/c/assets/32.Ck0pyuVo.png" alt="image-20240117091051284"></p><ul><li>⑧ 设置虚拟机的<code>内存</code>:至少 2048 MB以上。</li></ul><p><img src="/c/assets/33.CIADsdCq.png" alt="image-20240117091202131"></p><ul><li>⑨ 设置虚拟机的<code>网络类型</code>:下一步即可。</li></ul><p><img src="/c/assets/34.BzV_SbBH.png" alt="image-20240117091257738"></p><ul><li>⑩ 设置 I/O 控制器类型:下一步即可。</li></ul><p><img src="/c/assets/35.Bo4HrWyt.png" alt="image-20240117091402913"></p><ul><li>⑪ 选择磁盘类型:下一步即可。</li></ul><p><img src="/c/assets/36.BxT6-BCD.png" alt="image-20240117091540264"></p><ul><li>⑫ 选择磁盘:下一步即可。</li></ul><p><img src="/c/assets/37.D0PjA9j9.png" alt="image-20240117091640870"></p><ul><li>⑬ 选择磁盘容量:调整为 40 GB。</li></ul><p><img src="/c/assets/38.LpyAfrIN.png" alt="image-20240117091832846"></p><ul><li>⑭ 指定磁盘文件:下一步即可。</li></ul><p><img src="/c/assets/39.CjHtwv05.png" alt="image-20240117091907233"></p><ul><li>⑮ 创建虚拟机完毕:</li></ul><p><img src="/c/assets/40.LhfUlLI-.png" alt="image-20240117092013264"></p><ul><li>⑯ 查看是否创建虚拟机成功:</li></ul><p><img src="/c/assets/41.B-IGvwPu.png" alt="image-20240117092101810"></p><h3 id="_2-4-3-虚拟机归类-分类" tabindex="-1">2.4.3 虚拟机归类(分类) <a class="header-anchor" href="#_2-4-3-虚拟机归类-分类" aria-label="Permalink to &quot;2.4.3 虚拟机归类(分类)&quot;"></a></h3><ul><li>实际情况下,我们可能会创建很多<code>虚拟机</code>VMware 提供了<code>文件夹</code>的功能来管理虚拟机;其步骤如下所示:</li><li>① 鼠标右键 → 创建文件夹:</li></ul><p><img src="/c/assets/42.Cv35kD3U.png" alt="image-20240117092324545"></p><ul><li>② 修改文件夹的名称:</li></ul><p><img src="/c/assets/43.CbWzg9Wo.png" alt="image-20240117092600931"></p><p><img src="/c/assets/44.D0jAKgHg.png" alt="image-20240117092643086"></p><p><img src="/c/assets/45.N7X5TJ78.png" alt="image-20240117092720769"></p><ul><li>③ 将刚才创建的虚拟机<code></code>到该文件夹下:</li></ul><p><img src="/c/assets/46.Bfq_dWxy.gif" alt=""></p><h3 id="_2-4-4-设置-cd-dvd" tabindex="-1">2.4.4 设置 CD/DVD <a class="header-anchor" href="#_2-4-4-设置-cd-dvd" aria-label="Permalink to &quot;2.4.4 设置 CD/DVD&quot;"></a></h3><ul><li>以前,我们在一台裸机上安装操作系统的时候,需要通过 DVD 或 U 盘将操作系统的 ISO 镜像文件,安装到裸机上;</li><li>同理,在使用虚拟机软件的时候,也需要此类步骤;其步骤如下:</li><li>① 编辑虚拟机设置:</li></ul><p><img src="/c/assets/47.BnxhU1Er.png" alt="image-20240117093143947"></p><ul><li>② 选择硬盘上的 ISO 镜像文件:</li></ul><p><img src="/c/assets/48.BAsbyP0b.png" alt="image-20240117093354461"></p><ul><li>③ 查看是否配置成功:</li></ul><p><img src="/c/assets/49.Czjh0en6.png" alt="image-20240117093435976"></p><h2 id="_2-5-安装-linux" tabindex="-1">2.5 安装 Linux <a class="header-anchor" href="#_2-5-安装-linux" aria-label="Permalink to &quot;2.5 安装 Linux&quot;"></a></h2><ul><li><code>开启此虚拟机</code></li></ul><p><img src="/c/assets/50.pb4ZrBK3.png" alt="image-20240117093516070"></p><ul><li><code>鼠标点击</code>进去之后,通过键盘上的<code>方向键</code>来选择:</li></ul><p><img src="/c/assets/51.BEihShbE.png" alt="image-20240117093610205"></p><ul><li>注意⚠️:键盘上的<code>方向键</code>在这里</li></ul><p><img src="/c/assets/52.BSludYI3.png" alt="image-20240117093918602"></p><ul><li>③ 设置操作系统的<code>语言</code>环境为<code>中文</code></li></ul><p><img src="/c/assets/53.BTEDiHxD.png" alt="image-20240117094530342"></p><ul><li>④ 设置系统<code>安装目的地</code></li></ul><p><img src="/c/assets/54.DJgIi8D8.gif" alt=""></p><ul><li>⑤ 设置<code>软件选择</code>:默认即可</li></ul><p><img src="/c/assets/55.zm-zQ_F1.gif" alt=""></p><ul><li>⑥ 设置 root 的密码:<code>123456</code>即可</li></ul><p><img src="/c/assets/56.iRSQZsQa.gif" alt=""></p><div class="warning custom-block github-alert"><p class="custom-block-title">WARNING</p><p></p><p>学习阶段无所谓设置什么密码,但是生产环境,必须复杂并且经常更换!!!</p></div><ul><li>⑦ 配置<code>网络和主机名</code></li></ul><p><img src="/c/assets/57.3eVV4F-7.png" alt="image-20240224223931266"></p><p><img src="/c/assets/58.D-VKF5St.png" alt="image-20240224224038036"></p><p><img src="/c/assets/59.B047UE9Q.png" alt="image-20240224224138061"></p><p><img src="/c/assets/60.KLI33bZr.png" alt="image-20240224224209724"></p><p><img src="/c/assets/61.BBalzc2n.png" alt="image-20240224224245924"></p><p><img src="/c/assets/62.Du3ee2TL.png" alt="image-20240224224344051"></p><ul><li>⑧ 查看<code>配置网络和主机名</code>是否成功:</li></ul><p><img src="/c/assets/63.DeGflip3.png" alt="image-20240224224420273"></p><ul><li>⑨ 点击<code>开始安装</code>:漫长的等待……</li></ul><p><img src="/c/assets/64.X4Oech2H.gif" alt=""></p><ul><li>⑩ 安装完成之后,会提示<code>重启系统</code>,那就重启吧:</li></ul><p><img src="/c/assets/65.BZJUBf4b.gif" alt=""></p><h2 id="_2-6-远程连接-linux" tabindex="-1">2.6 远程连接 Linux <a class="header-anchor" href="#_2-6-远程连接-linux" aria-label="Permalink to &quot;2.6 远程连接 Linux&quot;"></a></h2><h3 id="_2-6-1-查看-linux-的-ip-地址" tabindex="-1">2.6.1 查看 Linux 的 IP 地址 <a class="header-anchor" href="#_2-6-1-查看-linux-的-ip-地址" aria-label="Permalink to &quot;2.6.1 查看 Linux 的 IP 地址&quot;"></a></h3><ul><li>通过 <code>ifconfig</code> 命令来查看 Linux 的 IP 地址:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">ifconfig</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/66.Du24cqu2.png" alt="image-20240117101543732"></p><h3 id="_2-6-2-远程连接-linux" tabindex="-1">2.6.2 远程连接 Linux <a class="header-anchor" href="#_2-6-2-远程连接-linux" aria-label="Permalink to &quot;2.6.2 远程连接 Linux&quot;"></a></h3><ul><li>可以通过 xshell 之类的远程连接工具来连接 Linux ,其步骤如下:</li><li>① 新建会话:</li></ul><p><img src="/c/assets/67.DGRQBd15.png" alt="image-20240117101749340"></p><ul><li>② 输入 Linux 的 IP 地址:</li></ul><p><img src="/c/assets/68.TYMcAvQa.png" alt="image-20240117101906927"></p><ul><li>③ 输入用户名和密码:</li></ul><p><img src="/c/assets/69.C49YAL2E.png" alt="image-20240117102005340"></p><ul><li>④ 接收和保存远程 Linux 的密钥:</li></ul><p><img src="/c/assets/70.Ds8vRWei.png" alt="image-20240117102123845"></p><ul><li>⑤ 查看是否登录成功:</li></ul><p><img src="/c/assets/71.9uHHAi6D.png" alt="image-20240117102159684"></p></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><div class="edit-info" data-v-e257564d><!----><div class="last-updated" data-v-e257564d><p class="VPLastUpdated" data-v-e257564d data-v-e98dd255>上次更新: <time datetime="2024-08-04T08:07:01.000Z" data-v-e98dd255></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><a class="VPLink link pager-link prev" href="/c/notes/03_build/01_${commonDirectoryName}/" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>上一篇</span><span class="title" data-v-e257564d>conan </span><!--]--></a></div><div class="pager" data-v-e257564d><!----></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-5d98c3a5 data-v-e315a0ad><div class="container" data-v-e315a0ad><p class="message" data-v-e315a0ad>Released under the MIT License.</p><p class="copyright" data-v-e315a0ad>Copyright © 2024 许大仙</p></div></footer><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DynzO91I\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DEs09TjE\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
</body>
</html>

View File

@ -8,9 +8,9 @@
<meta name="generator" content="VitePress v1.3.2">
<link rel="preload stylesheet" href="/c/assets/style.8enJ9bsK.css" as="style">
<script type="module" src="/c/assets/app.DS7FIVmo.js"></script>
<script type="module" src="/c/assets/app.DOv65PSF.js"></script>
<link rel="preload" href="/c/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
<link rel="modulepreload" href="/c/assets/chunks/theme.BqwVBBaA.js">
<link rel="modulepreload" href="/c/assets/chunks/theme.CfoaGUmH.js">
<link rel="modulepreload" href="/c/assets/chunks/framework.CZRoMP2i.js">
<link rel="modulepreload" href="/c/assets/notes_index.md.bgNns6d1.lean.js">
<link rel="shortcut icon" href="/c//logo.svg">
@ -21,7 +21,7 @@
</head>
<body>
<div id="app"><div class="Layout" data-v-5d98c3a5><!--[--><!--]--><!--[--><span tabindex="-1" data-v-0f60ec36></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-0f60ec36> Skip to content </a><!--]--><!----><header class="VPNav" data-v-5d98c3a5 data-v-ae24b3ad><div class="VPNavBar has-sidebar top" data-v-ae24b3ad data-v-6aa21345><div class="wrapper" data-v-6aa21345><div class="container" data-v-6aa21345><div class="title" data-v-6aa21345><div class="VPNavBarTitle has-sidebar" data-v-6aa21345 data-v-ab179fa1><a class="title" href="/c/" data-v-ab179fa1><!--[--><!--]--><!--[--><img class="VPImage logo" src="/c/logo.svg" alt data-v-8426fc1a><!--]--><span data-v-ab179fa1>许大仙</span><!--[--><!--]--></a></div></div><div class="content" data-v-6aa21345><div class="content-body" data-v-6aa21345><!--[--><!--]--><div class="VPNavBarSearch search" data-v-6aa21345><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><span class="vp-icon DocSearch-Search-Icon"></span><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-6aa21345 data-v-dc692963><span id="main-nav-aria-label" class="visually-hidden" data-v-dc692963> Main Navigation </span><!--[--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/" target="_blank" rel="noreferrer" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>首页</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/coa6/notes/" target="_blank" rel="noreferrer" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>计组6件套</span><!--]--></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup active" data-v-dc692963 data-v-b6c34ac9><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-b6c34ac9><span class="text" data-v-b6c34ac9><!----><span data-v-b6c34ac9>编程语言</span><span class="vpi-chevron-down text-icon" data-v-b6c34ac9></span></span></button><div class="menu" data-v-b6c34ac9><div class="VPMenu" data-v-b6c34ac9 data-v-b98bc113><div class="items" data-v-b98bc113><!--[--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link active" href="/c/notes/" data-v-43f1e123><!--[-->c/c++<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/web-design/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->前端<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/java/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->Java<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/big-data/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->大数据<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/linux/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->云原生<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/go/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->Go<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-43f1e123><a class="VPLink link vp-external-link-icon" href="https://aexiar.github.io/python/notes/" target="_blank" rel="noreferrer" data-v-43f1e123><!--[-->Python<!--]--></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/open-software/notes/" target="_blank" rel="noreferrer" tabindex="0" data-v-dc692963 data-v-9c663999><!--[--><span data-v-9c663999>开源软件</span><!--]--></a><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-6aa21345 data-v-6c893767><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-6c893767 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-6aa21345 data-v-0394ad82 data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/Aurorxa" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-eee4e7cb><span class="vpi-social-github" /></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-6aa21345 data-v-bb2aa2f0 data-v-b6c34ac9><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-b6c34ac9><span class="vpi-more-horizontal icon" data-v-b6c34ac9></span></button><div class="menu" data-v-b6c34ac9><div class="VPMenu" data-v-b6c34ac9 data-v-b98bc113><!----><!--[--><!--[--><!----><div class="group" data-v-bb2aa2f0><div class="item appearance" data-v-bb2aa2f0><p class="label" data-v-bb2aa2f0>Appearance</p><div class="appearance-action" data-v-bb2aa2f0><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-bb2aa2f0 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div></div></div><div class="group" data-v-bb2aa2f0><div class="item social-links" data-v-bb2aa2f0><div class="VPSocialLinks social-links-list" data-v-bb2aa2f0 data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/Aurorxa" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-eee4e7cb><span class="vpi-social-github" /></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-6aa21345 data-v-e5dd9c1c><span class="container" data-v-e5dd9c1c><span class="top" data-v-e5dd9c1c></span><span class="middle" data-v-e5dd9c1c></span><span class="bottom" data-v-e5dd9c1c></span></span></button></div></div></div></div><div class="divider" data-v-6aa21345><div class="divider-line" data-v-6aa21345></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-5d98c3a5 data-v-a6f0e41e><div class="container" data-v-a6f0e41e><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-a6f0e41e><span class="vpi-align-left menu-icon" data-v-a6f0e41e></span><span class="menu-text" data-v-a6f0e41e>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-a6f0e41e data-v-17a5e62e><button data-v-17a5e62e>返回顶部</button><!----></div></div></div><aside class="VPSidebar" data-v-5d98c3a5 data-v-319d5ca6><div class="curtain" data-v-319d5ca6></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-319d5ca6><span class="visually-hidden" id="sidebar-aria-label" data-v-319d5ca6> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h2 class="text" data-v-b7550ba0>C 语言基础</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/00_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>编程基础</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>C 语言入门</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/02_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>变量和进制</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/03_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>数据类型和运算符</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/04_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>流程控制</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/05_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>数组</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/06_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>指针</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/07_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>函数</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/08_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>预处理器</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/09_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>自定义数据类型</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/10_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>字符串和时间</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/11_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>内存管理</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/12_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>文件操作</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/13_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>调试工具和调试技巧gdb和make</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/01_c-basic/14_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>常用库函数</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h2 class="text" data-v-b7550ba0>C 语言高级</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>变量和内存分布</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/02_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>指针强化</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/03_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>结构体和文件的高级用法</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/04_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>链表和回调函数</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/02_c-advance/05_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>编译过程和面向接口</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h2 class="text" data-v-b7550ba0>项目构建工具</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><section class="VPSidebarItem level-1 collapsible collapsed" data-v-b7550ba0 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h3 class="text" data-v-b7550ba0>meson</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-2 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/03_build/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Gradle 入门</p><!--]--></a><!----></div><!----></div><!--]--></div></section><section class="VPSidebarItem level-1 collapsible collapsed" data-v-b7550ba0 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h3 class="text" data-v-b7550ba0>cmake</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-2 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/03_build/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Gradle 入门</p><!--]--></a><!----></div><!----></div><!--]--></div></section><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/03_build/01_${commonDirectoryName}/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>conan </p><!--]--></a><!----></div><!----></div><section class="VPSidebarItem level-1 collapsible collapsed" data-v-b7550ba0 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h3 class="text" data-v-b7550ba0>Gradle</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-2 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/03_build/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Gradle 入门</p><!--]--></a><!----></div><!----></div><!--]--></div></section><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><h2 class="text" data-v-b7550ba0>Linux</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b7550ba0><span class="vpi-chevron-right caret-icon" data-v-b7550ba0></span></div></div><div class="items" data-v-b7550ba0><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b7550ba0 data-v-b7550ba0><div class="item" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><a class="VPLink link link" href="/c/notes/04_linux/01_xdx/" data-v-b7550ba0><!--[--><p class="text" data-v-b7550ba0>Linux 初识和安装</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><div class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><p class="text" data-v-b7550ba0>C++ 核心编程</p><!----></div><!----></div></div><div class="no-transition group" data-v-c40bc020><div class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><p class="text" data-v-b7550ba0>C++ 标准库</p><!----></div><!----></div></div><div class="no-transition group" data-v-c40bc020><div class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><p class="text" data-v-b7550ba0>QT 桌面开发</p><!----></div><!----></div></div><div class="no-transition group" data-v-c40bc020><div class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b7550ba0><div class="item" role="button" tabindex="0" data-v-b7550ba0><div class="indicator" data-v-b7550ba0></div><p class="text" data-v-b7550ba0>Linux 高并发服务器开发</p><!----></div><!----></div></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-5d98c3a5 data-v-1428d186><div class="VPDoc has-sidebar has-aside" data-v-1428d186 data-v-39a288b8><!--[--><!--]--><div class="container" data-v-39a288b8><div class="aside" data-v-39a288b8><div class="aside-curtain" data-v-39a288b8></div><div class="aside-container" data-v-39a288b8><div class="aside-content" data-v-39a288b8><div class="VPDocAside" data-v-39a288b8 data-v-3f215769><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-3f215769 data-v-a5bbad30><div class="content" data-v-a5bbad30><div class="outline-marker" data-v-a5bbad30></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-a5bbad30>目录</div><ul class="VPDocOutlineItem root" data-v-a5bbad30 data-v-b933a997><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-3f215769></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-39a288b8><div class="content-container" data-v-39a288b8><!--[--><!--]--><main class="main" data-v-39a288b8><div style="position:relative;" class="vp-doc _c_notes_" data-v-39a288b8><div><h1 id="c-c-学科" tabindex="-1">c/c++ 学科 <a class="header-anchor" href="#c-c-学科" aria-label="Permalink to &quot;c/c++ 学科&quot;"></a></h1><hr><iframe src="https://roadmap.sh/r/embed?id=6695c8262b17b182cbf4b520" width="115%" height="500px" frameBorder="0"></iframe></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><div class="edit-info" data-v-e257564d><!----><div class="last-updated" data-v-e257564d><p class="VPLastUpdated" data-v-e257564d data-v-e98dd255>上次更新: <time datetime="2024-08-01T02:00:11.000Z" data-v-e98dd255></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><!----></div><div class="pager" data-v-e257564d><a class="VPLink link pager-link next" href="/c/notes/01_c-basic/00_xdx/" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>下一篇</span><span class="title" data-v-e257564d>编程基础</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-5d98c3a5 data-v-e315a0ad><div class="container" data-v-e315a0ad><p class="message" data-v-e315a0ad>Released under the MIT License.</p><p class="copyright" data-v-e315a0ad>Copyright © 2024 许大仙</p></div></footer><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DynzO91I\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"n0W-Fd-u\",\"notes_01_c-basic_00_xdx_index.md\":\"DrhS56yE\",\"notes_01_c-basic_01_xdx_index.md\":\"DEs09TjE\",\"notes_01_c-basic_02_xdx_index.md\":\"BaRUI6ln\",\"notes_01_c-basic_03_xdx_index.md\":\"lC6l29W7\",\"notes_01_c-basic_04_xdx_index.md\":\"DkXfRsso\",\"notes_01_c-basic_05_xdx_index.md\":\"Dzk0jyse\",\"notes_01_c-basic_06_xdx_index.md\":\"B8Z5KXti\",\"notes_04_linux_01_xdx_index.md\":\"D7-UlHSH\",\"notes_index.md\":\"bgNns6d1\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"许大仙\",\"titleTemplate\":\"Hi终于等到你\",\"description\":\"许大仙前端、Java、大数据、云原生\",\"base\":\"/c/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"lastUpdatedText\":\"上次更新\",\"returnToTopLabel\":\"返回顶部\",\"search\":{\"provider\":\"local\"},\"logo\":\"/logo.svg\",\"nav\":[{\"text\":\"首页\",\"link\":\"https://aexiar.github.io/\"},{\"text\":\"计组6件套\",\"link\":\"https://aexiar.github.io/coa6/notes/\"},{\"text\":\"编程语言\",\"items\":[{\"text\":\"c/c++\",\"link\":\"/notes/\"},{\"text\":\"前端\",\"link\":\"https://aexiar.github.io/web-design/notes/\"},{\"text\":\"Java\",\"link\":\"https://aexiar.github.io/java/notes/\"},{\"text\":\"大数据\",\"link\":\"https://aexiar.github.io/big-data/notes/\"},{\"text\":\"云原生\",\"link\":\"https://aexiar.github.io/linux/notes/\"},{\"text\":\"Go\",\"link\":\"https://aexiar.github.io/go/notes/\"},{\"text\":\"Python\",\"link\":\"https://aexiar.github.io/python/notes/\"}]},{\"text\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"编程基础\",\"link\":\"/notes/01_c-basic/00_xdx/\"},{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"},{\"text\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"},{\"text\":\"调试工具和调试技巧gdb和make\",\"link\":\"/notes/01_c-basic/13_xdx/\"},{\"text\":\"常用库函数\",\"link\":\"/notes/01_c-basic/14_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"变量和内存分布\",\"link\":\"/notes/02_c-advance/01_xdx/\"},{\"text\":\"指针强化\",\"link\":\"/notes/02_c-advance/02_xdx/\"},{\"text\":\"结构体和文件的高级用法\",\"link\":\"/notes/02_c-advance/03_xdx/\"},{\"text\":\"链表和回调函数\",\"link\":\"/notes/02_c-advance/04_xdx/\"},{\"text\":\"编译过程和面向接口\",\"link\":\"/notes/02_c-advance/05_xdx/\"}]},{\"text\":\"项目构建工具\",\"collapsed\":true,\"items\":[{\"text\":\"meson\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"cmake\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]},{\"text\":\"conan \",\"link\":\"/notes/03_build/01_${commonDirectoryName}/\"},{\"text\":\"Gradle\",\"collapsed\":true,\"items\":[{\"text\":\"Gradle 入门\",\"link\":\"/notes/03_build/01_xdx/\"}]}]},{\"text\":\"Linux\",\"collapsed\":true,\"items\":[{\"text\":\"Linux 初识和安装\",\"link\":\"/notes/04_linux/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
</body>
</html>