deploy: d65283ae9a316e1e4b75d8666bb172ec0ef8b81a

This commit is contained in:
Aurorxa 2024-07-15 07:26:44 +00:00
parent 882339735c
commit ec15af63b6
44 changed files with 95 additions and 37 deletions

View File

@ -8,7 +8,7 @@
<meta name="generator" content="VitePress v1.2.3">
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
<script type="module" src="/c/assets/app.NavY-WoM.js"></script>
<script type="module" src="/c/assets/app.DJvpVQC4.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("{\"notes_index.md\":\"CdHKXnBk\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cux_q1Jy\",\"index.md\":\"uFk6fSzW\"}");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\":\"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\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"初识 C 语言\",\"link\":\"/notes/02_dsa/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]}]},\"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\":\"uFk6fSzW\",\"notes_index.md\":\"CdHKXnBk\",\"notes_01_c-basic_02_xdx_index.md\":\"CB8oZG6k\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\"}");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\":\"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\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"初识 C 语言\",\"link\":\"/notes/02_dsa/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]}]},\"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>

BIN
assets/10.CmNKK_Ug.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

BIN
assets/11.CbGZ55Dj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
assets/12.DpTBR420.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

View File

Before

Width:  |  Height:  |  Size: 212 KiB

After

Width:  |  Height:  |  Size: 212 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 217 KiB

After

Width:  |  Height:  |  Size: 217 KiB

View File

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 103 KiB

View File

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

BIN
assets/3.6recRAvz.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

BIN
assets/4.DcyDw4rB.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
assets/5.q20QOAIA.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
assets/6.CmrWpBzQ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
assets/7.CocAjZjO.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 KiB

BIN
assets/8.CHZSlb-7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

BIN
assets/9.RD2M_pYn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

View File

@ -1 +1 @@
import{U as o,a6 as p,a7 as u,a8 as l,a9 as c,aa as f,ab as d,ac as m,ad as h,ae as g,af as A,d as P,u as v,y,x as w,ag as C,ah as R,ai as b,a4 as E}from"./chunks/framework.BE8if9e6.js";import{R as S}from"./chunks/theme.Dwe0RGAL.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(S),T=P({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=v();return y(()=>{w(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),R(),b(),s.setup&&s.setup(),()=>E(s.Layout)}});async function _(){globalThis.__VITEPRESS__=!0;const e=D(),a=x();a.provide(u,e);const t=l(e.route);return a.provide(c,t),a.component("Content",f),a.component("ClientOnly",d),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:m}),{app:a,router:e,data:t}}function x(){return h(T)}function D(){let e=o,a;return g(t=>{let n=A(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&&_().then(({app:e,router:a,data:t})=>{a.go().then(()=>{p(a.route,t.site),e.mount("#app")})});export{_ as createApp};
import{U as o,a6 as p,a7 as u,a8 as l,a9 as c,aa as f,ab as d,ac as m,ad as h,ae as g,af as A,d as P,u as v,y,x as w,ag as C,ah as R,ai as b,a4 as E}from"./chunks/framework.BE8if9e6.js";import{R as S}from"./chunks/theme.C4MahGFn.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(S),T=P({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=v();return y(()=>{w(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),R(),b(),s.setup&&s.setup(),()=>E(s.Layout)}});async function _(){globalThis.__VITEPRESS__=!0;const e=D(),a=x();a.provide(u,e);const t=l(e.route);return a.provide(c,t),a.component("Content",f),a.component("ClientOnly",d),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:m}),{app:a,router:e,data:t}}function x(){return h(T)}function D(){let e=o,a;return g(t=>{let n=A(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&&_().then(({app:e,router:a,data:t})=>{a.go().then(()=>{p(a.route,t.site),e.mount("#app")})});export{_ 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 Ct=Object.defineProperty;var It=(o,e,t)=>e in o?Ct(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var Oe=(o,e,t)=>It(o,typeof e!="symbol"?e+"":e,t);import{X as Dt,s as oe,v as $e,aj as kt,ak as Ot,d as Rt,G as xe,al as tt,h as Fe,am as _t,an as Mt,x as Lt,ao as Pt,y as Re,R as de,Q as Ee,ap as zt,aq as Bt,Y as Vt,U as $t,ar as Wt,o as ee,b as Kt,j as k,a1 as Jt,k as j,as as Ut,at as jt,au as Gt,c as re,n as rt,e as Se,E as at,F as nt,a as ve,t as pe,av as Qt,p as qt,l as Ht,aw as it,a3 as Yt,a9 as Zt,af as Xt,ax as er,_ as tr}from"./framework.BE8if9e6.js";import{u as rr,c as ar}from"./theme.Dwe0RGAL.js";const nr={root:()=>Dt(()=>import("./@localSearchIndexroot.D0S44lpi.js"),[])};/*!
var Ct=Object.defineProperty;var It=(o,e,t)=>e in o?Ct(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var Oe=(o,e,t)=>It(o,typeof e!="symbol"?e+"":e,t);import{X as Dt,s as oe,v as $e,aj as kt,ak as Ot,d as Rt,G as xe,al as tt,h as Fe,am as _t,an as Mt,x as Lt,ao as Pt,y as Re,R as de,Q as Ee,ap as zt,aq as Bt,Y as Vt,U as $t,ar as Wt,o as ee,b as Kt,j as k,a1 as Jt,k as j,as as Ut,at as jt,au as Gt,c as re,n as rt,e as Se,E as at,F as nt,a as ve,t as pe,av as Qt,p as qt,l as Ht,aw as it,a3 as Yt,a9 as Zt,af as Xt,ax as er,_ as tr}from"./framework.BE8if9e6.js";import{u as rr,c as ar}from"./theme.C4MahGFn.js";const nr={root:()=>Dt(()=>import("./@localSearchIndexroot.RkGdzhVE.js"),[])};/*!
* tabbable 6.2.0
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
*/var yt=["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])"],Ne=yt.join(","),mt=typeof Element>"u",ue=mt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ce=!mt&&Element.prototype.getRootNode?function(o){var e;return o==null||(e=o.getRootNode)===null||e===void 0?void 0:e.call(o)}:function(o){return o==null?void 0:o.ownerDocument},Ie=function o(e,t){var r;t===void 0&&(t=!0);var n=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),a=n===""||n==="true",i=a||t&&e&&o(e.parentNode);return i},ir=function(e){var t,r=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return r===""||r==="true"},gt=function(e,t,r){if(Ie(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(Ne));return t&&ue.call(e,Ne)&&n.unshift(e),n=n.filter(r),n},bt=function o(e,t,r){for(var n=[],a=Array.from(e);a.length;){var i=a.shift();if(!Ie(i,!1))if(i.tagName==="SLOT"){var s=i.assignedElements(),u=s.length?s:i.children,l=o(u,!0,r);r.flatten?n.push.apply(n,l):n.push({scopeParent:i,candidates:l})}else{var h=ue.call(i,Ne);h&&r.filter(i)&&(t||!e.includes(i))&&n.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),v=!Ie(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(d&&v){var y=o(d===!0?i.children:d.children,!0,r);r.flatten?n.push.apply(n,y):n.push({scopeParent:i,candidates:y})}else a.unshift.apply(a,i.children)}}return n},wt=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},se=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||ir(e))&&!wt(e)?0:e.tabIndex},or=function(e,t){var r=se(e);return r<0&&t&&!wt(e)?0:r},sr=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},xt=function(e){return e.tagName==="INPUT"},ur=function(e){return xt(e)&&e.type==="hidden"},lr=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return t},cr=function(e,t){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===t)return e[r]},fr=function(e){if(!e.name)return!0;var t=e.form||Ce(e),r=function(s){return t.querySelectorAll('input[type="radio"][name="'+s+'"]')},n;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")n=r(window.CSS.escape(e.name));else try{n=r(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 a=cr(n,e.form);return!a||a===e},hr=function(e){return xt(e)&&e.type==="radio"},dr=function(e){return hr(e)&&!fr(e)},vr=function(e){var t,r=e&&Ce(e),n=(t=r)===null||t===void 0?void 0:t.host,a=!1;if(r&&r!==e){var i,s,u;for(a=!!((i=n)!==null&&i!==void 0&&(s=i.ownerDocument)!==null&&s!==void 0&&s.contains(n)||e!=null&&(u=e.ownerDocument)!==null&&u!==void 0&&u.contains(e));!a&&n;){var l,h,d;r=Ce(n),n=(l=r)===null||l===void 0?void 0:l.host,a=!!((h=n)!==null&&h!==void 0&&(d=h.ownerDocument)!==null&&d!==void 0&&d.contains(n))}}return a},ot=function(e){var t=e.getBoundingClientRect(),r=t.width,n=t.height;return r===0&&n===0},pr=function(e,t){var r=t.displayCheck,n=t.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var a=ue.call(e,"details>summary:first-of-type"),i=a?e.parentElement:e;if(ue.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof n=="function"){for(var s=e;e;){var u=e.parentElement,l=Ce(e);if(u&&!u.shadowRoot&&n(u)===!0)return ot(e);e.assignedSlot?e=e.assignedSlot:!u&&l!==e.ownerDocument?e=l.host:e=u}e=s}if(vr(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return ot(e);return!1},yr=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var r=0;r<t.children.length;r++){var n=t.children.item(r);if(n.tagName==="LEGEND")return ue.call(t,"fieldset[disabled] *")?!0:!n.contains(e)}return!0}t=t.parentElement}return!1},De=function(e,t){return!(t.disabled||Ie(t)||ur(t)||pr(t,e)||lr(t)||yr(t))},We=function(e,t){return!(dr(t)||se(t)<0||!De(e,t))},mr=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},gr=function o(e){var t=[],r=[];return e.forEach(function(n,a){var i=!!n.scopeParent,s=i?n.scopeParent:n,u=or(s,i),l=i?o(n.candidates):s;u===0?i?t.push.apply(t,l):t.push(s):r.push({documentOrder:a,tabIndex:u,item:n,isScope:i,content:l})}),r.sort(sr).reduce(function(n,a){return a.isScope?n.push.apply(n,a.content):n.push(a.content),n},[]).concat(t)},br=function(e,t){t=t||{};var r;return t.getShadowRoot?r=bt([e],t.includeContainer,{filter:We.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:mr}):r=gt(e,t.includeContainer,We.bind(null,t)),gr(r)},wr=function(e,t){t=t||{};var r;return t.getShadowRoot?r=bt([e],t.includeContainer,{filter:De.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):r=gt(e,t.includeContainer,De.bind(null,t)),r},le=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return ue.call(e,Ne)===!1?!1:We(t,e)},xr=yt.concat("iframe").join(","),_e=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return ue.call(e,xr)===!1?!1:De(t,e)};/*!

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
import{_ as s,c as i,o as a,a5 as n}from"./chunks/framework.BE8if9e6.js";const l="/c/assets/1.CXNJqOOc.png",e="/c/assets/2.E0LS08Y5.png",t="/c/assets/3.XcPl7d9s.png",p="/c/assets/4.DL02VQMp.png",h="/c/assets/5.Dr67r_Ws.png",d="/c/assets/6.C5XiXNVN.png",k="/c/assets/7.DO8XxSV6.jpg",r="/c/assets/8.CUXrdefp.jpeg",c="/c/assets/9.uqLiL_yu.png",o="/c/assets/10.CkykpHY2.png",E="/c/assets/11.DV1YbrOP.png",u="/c/assets/12.AHNJT9TV.png",b="/c/assets/13.Bs-MOwx2.png",g="/c/assets/14.StzjmBz-.png",F="/c/assets/15.C0wVWaxD.png",y="/c/assets/16.LXJMAihe.png",m="/c/assets/17._UTCq3PD.png",C="/c/assets/18.BjQ5kBL-.png",B="/c/assets/19.COIOzcmT.png",v="/c/assets/20.Cu__mjav.png",A="/c/assets/21.BX_KzkHt.png",_="/c/assets/22.COt_QxSP.png",S=JSON.parse('{"title":"第一章:变量(⭐)","description":"","frontmatter":{},"headers":[],"relativePath":"notes/01_c-basic/02_xdx/index.md","filePath":"notes/01_c-basic/02_xdx/index.md","lastUpdated":1720685105000}'),D={name:"notes/01_c-basic/02_xdx/index.md"},q=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><ul><li>在生活中,我们使用最多的不是固定的数据,而是会变化的数据: <ul><li>① 购物车商品的<code>数量</code>、<code>价格</code>等。</li><li>② 一首歌<code>播放的时间</code>、<code>进度条</code>、<code>歌词的展示</code>等。</li><li>③ 微信聊天中<code>消息条数</code>、<code>时间</code>、<code>语音的长度</code>、<code>头像</code>、<code>名称</code>等。</li><li>④ 游戏中技能的<code>冷却时间</code>、<code>血量</code>、<code>蓝量</code>、<code>buff 时间</code>、<code>金币的数量</code>等。</li><li>……</li></ul></li></ul><ul><li>下图是一个<code>购物车</code>中<code>变化</code>的<code>数据</code>,即:</li></ul><p><img src="'+l+'" alt=""></p><ul><li>那么,在实际开发中,我们就会使用<code>变量</code>来<code>保存</code>和<code>操作</code>这些<code>变化</code>的<code>数据</code>。</li></ul><h2 id="_1-2-变量" tabindex="-1">1.2 变量 <a class="header-anchor" href="#_1-2-变量" aria-label="Permalink to &quot;1.2 变量&quot;"></a></h2><ul><li>变量的定义:变量是程序中不可或缺的组成单位,最基本的存储单元。其实,变量就是一个存储数据的临时空间,可以向其中存储不同类型的数据,如:整数、小数、字符、字符串等,并且变量中的数据在程序运行的时候可以动态改变。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li><code>变量</code>:用来<code>存储数据</code>的<code>容器</code>。</li><li><code>数据</code>:可以是一个用来计算的<code>数字</code>,如:上文购物车中的<code>价格</code>等;也可以是一句话中的<code>关键词</code>或<code>其它任意格式的数据</code>。</li><li>变量的<code>特别</code>之处就在于<code>它存放的数据是可以改变</code>的。</li></ul></div><ul><li>我们可以将<code>变量</code>想象为一个<code>容器</code>,盒子中<code>装的</code>就是我们想要的<code>数据</code>,并且我们需要<code>给</code>盒子<code>取</code>一个<code>特别的名称</code>;通过这个<code>特别的名称</code>,我们可以<code>给</code>盒子<code>添加数据</code>或<code>移除数据</code>,这个<code>特别的名称</code>就是<code>变量名</code>。</li></ul><p><img src="'+e+`" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① <code>变量</code>是内存中的一个<code>存储区域</code>,该区域的数据可以在<code>同一类型</code>范围内<code>不断变化</code>。</li><li>② 通过<code>变量名</code>,可以<code>操作</code>这块内存区域,向其中<code>存储数据</code>或<code>获取数据</code>以及<code>移除数据</code>。</li><li>③ 变量的构成包含三个要素:<code>数据类型</code>、<code>变量名</code>、<code>需要存储的数据</code>。</li><li>④ 在生活中,我们会经常说:这件衣服的价格是 <code>100整型</code> 元,这双鞋子的价格是 <code>250.5(小数,浮点类型)</code> 元,<code>今天天气真好(字符串类型)</code>之类的话;在计算机科学中,这些都是数据,并且它们是有类型,即:数据类型。(数据类型用于定义变量所能存储的数据的种类以及可以对这些数据进行的操作的一种分类,每种数据类型都有特定的属性和用途,它们决定了变量在内存中如何表示和存储,以及变量可以执行哪些操作)</li></ul></div><h2 id="_1-3-变量的声明和使用" tabindex="-1">1.3 变量的声明和使用 <a class="header-anchor" href="#_1-3-变量的声明和使用" aria-label="Permalink to &quot;1.3 变量的声明和使用&quot;"></a></h2><ul><li>① 变量必须先声明,后使用。</li><li>② 可以先声明变量再赋值,也可以在声明变量的同时进行赋值。</li><li>③ 变量的值可以在同一类型范围内不断变化。</li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>在实际开发中,我们通常都会在声明变量的同时,给其赋值,这被称为初始化。</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>
import{_ as s,c as i,o as a,a5 as n}from"./chunks/framework.BE8if9e6.js";const l="/c/assets/1.CXNJqOOc.png",e="/c/assets/2.E0LS08Y5.png",t="/c/assets/3.6recRAvz.jpeg",p="/c/assets/4.DcyDw4rB.jpg",h="/c/assets/5.q20QOAIA.png",d="/c/assets/6.CmrWpBzQ.png",k="/c/assets/7.CocAjZjO.png",r="/c/assets/8.CHZSlb-7.png",c="/c/assets/9.RD2M_pYn.png",o="/c/assets/10.CmNKK_Ug.png",u="/c/assets/11.CbGZ55Dj.png",E="/c/assets/12.DpTBR420.png",b="/c/assets/13.XcPl7d9s.png",g="/c/assets/14.DL02VQMp.png",F="/c/assets/15.Dr67r_Ws.png",y="/c/assets/16.C5XiXNVN.png",m="/c/assets/17.DO8XxSV6.jpg",C="/c/assets/18.CUXrdefp.jpeg",B="/c/assets/19.uqLiL_yu.png",v="/c/assets/20.CkykpHY2.png",A="/c/assets/21.DV1YbrOP.png",D="/c/assets/22.AHNJT9TV.png",_="/c/assets/23.Bs-MOwx2.png",q="/c/assets/24.StzjmBz-.png",f="/c/assets/25.C0wVWaxD.png",x="/c/assets/26.LXJMAihe.png",P="/c/assets/27._UTCq3PD.png",O="/c/assets/28.BjQ5kBL-.png",T="/c/assets/29.COIOzcmT.png",N="/c/assets/30.Cu__mjav.png",M="/c/assets/31.BX_KzkHt.png",w="/c/assets/32.COt_QxSP.png",K=JSON.parse('{"title":"第一章:变量(⭐)","description":"","frontmatter":{},"headers":[],"relativePath":"notes/01_c-basic/02_xdx/index.md","filePath":"notes/01_c-basic/02_xdx/index.md","lastUpdated":1721028373000}'),I={name:"notes/01_c-basic/02_xdx/index.md"},U=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><ul><li>在生活中,我们使用最多的不是固定的数据,而是会变化的数据: <ul><li>① 购物车商品的<code>数量</code>、<code>价格</code>等。</li><li>② 一首歌<code>播放的时间</code>、<code>进度条</code>、<code>歌词的展示</code>等。</li><li>③ 微信聊天中<code>消息条数</code>、<code>时间</code>、<code>语音的长度</code>、<code>头像</code>、<code>名称</code>等。</li><li>④ 游戏中技能的<code>冷却时间</code>、<code>血量</code>、<code>蓝量</code>、<code>buff 时间</code>、<code>金币的数量</code>等。</li><li>……</li></ul></li></ul><ul><li>下图是一个<code>购物车</code>中<code>变化</code>的<code>数据</code>,即:</li></ul><p><img src="'+l+'" alt=""></p><ul><li>那么,在实际开发中,我们就会使用<code>变量</code>来<code>保存</code>和<code>操作</code>这些<code>变化</code>的<code>数据</code>。</li></ul><h2 id="_1-2-变量" tabindex="-1">1.2 变量 <a class="header-anchor" href="#_1-2-变量" aria-label="Permalink to &quot;1.2 变量&quot;"></a></h2><ul><li>变量的定义:变量是程序中不可或缺的组成单位,最基本的存储单元。其实,变量就是一个存储数据的临时空间,可以向其中存储不同类型的数据,如:整数、小数、字符、字符串等,并且变量中的数据在程序运行的时候可以动态改变。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li><code>变量</code>:用来<code>存储数据</code>的<code>容器</code>。</li><li><code>数据</code>:可以是一个用来计算的<code>数字</code>,如:上文购物车中的<code>价格</code>等;也可以是一句话中的<code>关键词</code>或<code>其它任意格式的数据</code>。</li><li>变量的<code>特别</code>之处就在于<code>它存放的数据是可以改变</code>的。</li></ul></div><ul><li>我们可以将<code>变量</code>想象为一个<code>容器</code>,盒子中<code>装的</code>就是我们想要的<code>数据</code>,并且我们需要<code>给</code>盒子<code>取</code>一个<code>特别的名称</code>;通过这个<code>特别的名称</code>,我们可以<code>给</code>盒子<code>添加数据</code>或<code>移除数据</code>,这个<code>特别的名称</code>就是<code>变量名</code>。</li></ul><p><img src="'+e+`" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① <code>变量</code>是内存中的一个<code>存储区域</code>,该区域的数据可以在<code>同一类型</code>范围内<code>不断变化</code>。</li><li>② 通过<code>变量名</code>,可以<code>操作</code>这块内存区域,向其中<code>存储数据</code>或<code>获取数据</code>以及<code>移除数据</code>。</li><li>③ 变量的构成包含三个要素:<code>数据类型</code>、<code>变量名</code>、<code>需要存储的数据</code>。</li><li>④ 在生活中,我们会经常说:这件衣服的价格是 <code>100整型</code> 元,这双鞋子的价格是 <code>250.5(小数,浮点类型)</code> 元,<code>今天天气真好(字符串类型)</code>之类的话;在计算机科学中,这些都是数据,并且它们是有类型,即:数据类型。(数据类型用于定义变量所能存储的数据的种类以及可以对这些数据进行的操作的一种分类,每种数据类型都有特定的属性和用途,它们决定了变量在内存中如何表示和存储,以及变量可以执行哪些操作)</li></ul></div><h2 id="_1-3-变量的声明和使用" tabindex="-1">1.3 变量的声明和使用 <a class="header-anchor" href="#_1-3-变量的声明和使用" aria-label="Permalink to &quot;1.3 变量的声明和使用&quot;"></a></h2><ul><li>① 变量必须先声明,后使用。</li><li>② 可以先声明变量再赋值,也可以在声明变量的同时进行赋值。</li><li>③ 变量的值可以在同一类型范围内不断变化。</li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>在实际开发中,我们通常都会在声明变量的同时,给其赋值,这被称为初始化。</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>
<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>
@ -35,9 +35,16 @@ import{_ as s,c as i,o as a,a5 as n}from"./chunks/framework.BE8if9e6.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;c3 = </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d\\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, c3);</span></span>
<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></div></div><h2 id="_1-4-" tabindex="-1">1.4 <a class="header-anchor" href="#_1-4-" aria-label="Permalink to &quot;1.4 &quot;"></a></h2><ul><li><code></code><code></code>CPU </li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>()</p><p>()</p></div><p><img src="`+t+`" alt=""></p><ul><li> C <code>printf()</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;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> char</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">__format</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></div></div><h2 id="_1-4-" tabindex="-1">1.4 <a class="header-anchor" href="#_1-4-" aria-label="Permalink to &quot;1.4 &quot;"></a></h2><h3 id="_1-4-1-" tabindex="-1">1.4.1 <a class="header-anchor" href="#_1-4-1-" aria-label="Permalink to &quot;1.4.1 &quot;"></a></h3><ul><li></li></ul><p><img src="`+t+'" alt=""></p><ul><li></li></ul><p><img src="'+p+'" alt=""></p><ul><li> 4 2 4 </li></ul><p><img src="'+h+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li> DIMM DIMM </li><li> DIMM </li><li> DIMM UDIMM DIMMRDIMM DIMM LRDIMMDIMM</li></ul></div><ul><li> <a href="https://www.cpuid.com/" target="_blank" rel="noreferrer">CPU-Z</a> CPU </li></ul><p><img src="'+d+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li> CPU-Z <code>channel</code> <code></code><code></code><code></code><code></code></li><li> </li><li> 使</li><li> Dual ChannelQuad ChannelOcta Channel</li></ul></div><ul><li></li></ul><p><img src="'+k+'" alt=""></p><ul><li><code>1</code> <code>2</code> <code>3</code> <code>4</code> <ul><li> 1 <code>2</code> </li><li> 2 <code>2</code> <code>4</code> </li><li> 4 </li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p></p><ul><li> <strong></strong></li><li> <strong></strong>DDR4-2400DDR4-3200</li><li> <strong></strong>CL16-18-18-38</li><li> <strong></strong></li></ul></div><ul><li></li></ul><p><img src="'+r+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> 8 9 1 ECC </p></div><ul><li> Rank Rank0 Rank1 </li></ul><p><img src="'+c+'" alt=""></p><ul><li> chip </li></ul><p><img src="'+o+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li> DRAM </li><li> </li></ul></div><ul><li> chip 8 bank bank bank column row bank 8bit 1 Bytes</li></ul><p><img src="'+u+'" alt="img"></p><ul><li> <code>Channel &gt; DIMM &gt; Rank -&gt; Chip -&gt; Bank -&gt; Row/Column</code></li></ul><h3 id="_1-4-2-" tabindex="-1">1.4.2 <a class="header-anchor" href="#_1-4-2-" aria-label="Permalink to &quot;1.4.2 &quot;"></a></h3><ul><li><p> 10 20 </p><ul><li> 10 20 CPU CPU ALU</li><li> 10 20 CPU CPU 10 20 </li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>使 10 20 CPU </p></div><ul><li> CPU </li></ul></li><li><p><code></code></p></li></ul><p><img src="'+E+`" alt=""></p><ul><li>使</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>使</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>LOAD A, 16 -- --&gt; 0000,0000,000000010000</span></span>
<span class="line"><span>LOAD B, 1 -- 编译 --&gt; 0000,0001,000000000001</span></span>
<span class="line"><span>STORE B, 16 -- 编译 --&gt; 0001,0001,000000010000</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>使</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;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> num </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 10</span><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></div></div><ul><li><p>使<code></code><code></code><code></code>便使</p></li><li><p></p><ul><li> 使</li><li> </li><li> </li></ul></li><li><p><code></code><code></code><code></code></p></li><li><p><code></code><code></code><code></code>Bytes 8 0 1 </p></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>00011001 00100110 00100110 00100110 00100110 ...</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></p><ul><li>1 B = 8 bit</li><li>1 KB = 1024 B</li><li>1 MB = 1024 KB</li><li>1 GB = 1024 MB</li><li>1 TB = 1024 GB </li><li></li></ul></div><ul><li> 1 1 CPU </li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p></p></div><ul><li><p> 1 4 CPU CPU <code></code></p><ul><li> <code>a</code> <code>01</code> <code>4</code> </li><li> CPU <code>01 ~ 04</code> </li></ul></li><li><p></p></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> = ;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><ul><li><code></code><code></code> <ul><li> <code></code>使<code></code><code></code><code></code></li><li> CPU <code></code><code></code></li></ul></li></ul><div class="caution custom-block github-alert"><p class="custom-block-title">CAUTION</p><p></p><p></p></div><ul><li><p><code></code><code></code></p><ul><li> <code></code>CPU </li><li> <code></code>JavaScript char string string Java char unicode </li></ul></li><li><p><code></code><code></code></p><ul><li> <code></code><code></code><code></code><code></code></li><li> <code>=</code> </li></ul></li><li><p></p></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;">// int 4 </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// num 变量名 -- 关联内存中的一块存储空间</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// = 10 将 10 存储到 num 所代表的 4 个字节的存储空间中</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> num </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 10</span><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></div></div><h2 id="_1-6-" tabindex="-1">1.6 <a class="header-anchor" href="#_1-6-" aria-label="Permalink to &quot;1.6 &quot;"></a></h2><h3 id="_1-6-1-" tabindex="-1">1.6.1 <a class="header-anchor" href="#_1-6-1-" aria-label="Permalink to &quot;1.6.1 &quot;"></a></h3><ul><li><code></code><code></code>CPU </li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>()</p><p>()</p></div><p><img src="`+b+`" alt=""></p><ul><li> C <code>printf()</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;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> char</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">__format</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, ...) {</span></span>
<span class="line"><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></div></div><ul><li><code>printf</code> <code>print formatted</code></li></ul><p><img src="`+p+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>使</li><li> <code>%</code> <code></code> <code>%d</code> </li><li></li></ul></div><ul><li><p></p><ul><li>binary bin</li><li>octal oct</li><li>decimal dec</li><li>Hexadecimal hex</li></ul></li><li><p> Windows </p></li></ul><p><img src="'+h+`" alt=""></p><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p> decimal C decimal decimal integer </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>
<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></div></div><ul><li><code>printf</code> <code>print formatted</code></li></ul><p><img src="`+g+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>使</li><li> <code>%</code> <code></code> <code>%d</code> </li><li></li></ul></div><ul><li><p></p><ul><li>binary bin</li><li>octal oct</li><li>decimal dec</li><li>Hexadecimal hex</li></ul></li><li><p> Windows </p></li></ul><p><img src="'+F+`" alt=""></p><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p> decimal decimal decimal integer </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>
<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>
@ -48,9 +55,31 @@ import{_ as s,c as i,o as a,a5 as n}from"./chunks/framework.BE8if9e6.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;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, num);</span></span>
<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></div></div><h2 id="_1-5-" tabindex="-1">1.5 <a class="header-anchor" href="#_1-5-" aria-label="Permalink to &quot;1.5 &quot;"></a></h2><ul><li> C <code>scanf()</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;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> scanf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> char</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">__format</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></div></div><h3 id="_1-6-2-" tabindex="-1">1.6.2 <a class="header-anchor" href="#_1-6-2-" aria-label="Permalink to &quot;1.6.2 &quot;"></a></h3><ul><li><p>使 <code>sizeof</code></p></li><li><p></p></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>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> num </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 10</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<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;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%zd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\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;">sizeof</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(num));</span></span>
<span class="line"></span>
<span class="line"><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;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%zd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\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;">sizeof</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">));</span></span>
<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></div></div><h3 id="_1-6-3-" tabindex="-1">1.6.3 <a class="header-anchor" href="#_1-6-3-" aria-label="Permalink to &quot;1.6.3 &quot;"></a></h3><ul><li><p> C 使<code> &amp;</code> </p></li><li><p></p></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>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> num </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 10</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<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; num </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d\\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, num);</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; num ()</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:#24292E;--shiki-dark:#E1E4E8;">num);</span></span>
<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><h3 id="_1-6-4-" tabindex="-1">1.6.4 <a class="header-anchor" href="#_1-6-4-" aria-label="Permalink to &quot;1.6.4 &quot;"></a></h3><ul><li> C <code>scanf()</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;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> scanf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> char</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">__format</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, ...) {</span></span>
<span class="line"><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></div></div><ul><li></li></ul><p><img src="`+d+`" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p><code>&amp;age</code><code>&amp;num</code> <code>&amp;</code><code>&amp;age</code> <code>age</code> </p></div><div class="caution custom-block github-alert"><p class="custom-block-title">CAUTION</p><p></p><ul><li><p> scanf() <code>%d</code><code>%d%d</code>使<code>,</code>使tab <code>23tab</code><code>2tab3</code></p></li><li><p> <code>%d,%d</code><code>,</code><code>2,3</code></p></li><li><p> <code>%d %d</code><code>23</code></p></li></ul></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>
<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></div></div><ul><li></li></ul><p><img src="`+y+`" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p><code>&amp;age</code><code>&amp;num</code> <code>&amp;</code><code>&amp;age</code> <code>age</code> </p></div><div class="caution custom-block github-alert"><p class="custom-block-title">CAUTION</p><p></p><ul><li><p> scanf() <code>%d</code><code>%d%d</code>使<code>,</code>使tab <code>23tab</code><code>2tab3</code></p></li><li><p> <code>%d,%d</code><code>,</code><code>2,3</code></p></li><li><p> <code>%d %d</code><code>23</code></p></li></ul></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>
<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>
@ -97,7 +126,7 @@ import{_ as s,c as i,o as a,a5 as n}from"./chunks/framework.BE8if9e6.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;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> × </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> × </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> = </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, a, b, c, result);</span></span>
<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><h2 id="_1-6-" tabindex="-1">1.6 <a class="header-anchor" href="#_1-6-" aria-label="Permalink to &quot;1.6 &quot;"></a></h2><h3 id="_1-6-1-" tabindex="-1">1.6.1 <a class="header-anchor" href="#_1-6-1-" aria-label="Permalink to &quot;1.6.1 &quot;"></a></h3><ul><li> C 使</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> 60 - 70 <code></code><code></code><code></code><code></code> <code></code><code></code><code></code><code></code></p></div><h3 id="_1-6-2-" tabindex="-1">1.6.2 <a class="header-anchor" href="#_1-6-2-" aria-label="Permalink to &quot;1.6.2 &quot;"></a></h3><ul><li><p></p><ul><li> <code></code><code></code><code>0-9</code> <code>_</code> </li><li> <code></code></li><li> <code></code></li><li> <code></code> 63 </li><li> <code></code>Hellohello </li></ul></li><li><p></p><ul><li> 使sumnamemaxyear </li><li> 使线max_classes_per_student </li><li> 使线使 studentIdstudent_name </li><li> nameName </li><li> 使线C99 <code>_Bool</code>使线</li></ul></li><li><p></p></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>aBOOK_sunMAX_SIZEMousestudent23FootballFOOTBALLmax_addnum_1sum_of_numbers</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-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>$zj3sumab#cd23studentFoot-baiis.combcj**pbook-1tax ratedon&#39;t</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><h3 id="_1-6-3-" tabindex="-1">1.6.3 <a class="header-anchor" href="#_1-6-3-" aria-label="Permalink to &quot;1.6.3 &quot;"></a></h3><ul><li>C <code></code><code></code><code></code><code></code><code></code></li><li>C80 C90 ANSI C</li></ul><table tabindex="0"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td></td><td><code>char</code><code>double</code><code>float</code><code>int</code><code>long</code><code>short</code><code>signed</code><code>unsigned</code><code>void</code></td></tr><tr><td></td><td><code>auto</code><code>extern</code><code>register</code><code>static</code><code>typedef</code><code>volatile</code><code>const</code></td></tr><tr><td></td><td><code>break</code><code>case</code><code>continue</code><code>default</code><code>do</code><code>else</code><code>for</code><code>goto</code><code>if</code><code>return</code><code>switch</code><code>while</code></td></tr><tr><td></td><td><code>enum</code><code>struct</code><code>union</code></td></tr><tr><td></td><td><code>sizeof</code></td></tr></tbody></table><ul><li>C99 </li></ul><table tabindex="0"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td></td><td><code>_Bool</code><code>_Complex</code><code>_Imaginary</code></td></tr><tr><td></td><td><code>inline</code><code>restrict</code></td></tr><tr><td></td><td><code>_Complex</code> <code>_Imaginary</code></td></tr></tbody></table><ul><li>C11 </li></ul><table tabindex="0"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td></td><td><code>_Atomic</code></td></tr><tr><td></td><td><code>_Alignas</code> <code>_Alignof</code> <code>_Generic</code> <code>_Noreturn</code> <code>_Static_assert</code> <code>_Thread_local</code></td></tr></tbody></table><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li> </li><li> 使</li></ul></div><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></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li> <code>π</code> 3.1415926 </li><li> <code></code><code></code><code></code><code></code></li><li> ...</li></ul></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> C <ul><li> </li><li> <ul><li><code>#define</code> </li><li><code>const</code> </li><li></li></ul></li></ul></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>#define</code> <code>const</code> </li></ul></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>
<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><h2 id="_1-7-" tabindex="-1">1.7 <a class="header-anchor" href="#_1-7-" aria-label="Permalink to &quot;1.7 &quot;"></a></h2><h3 id="_1-7-1-" tabindex="-1">1.7.1 <a class="header-anchor" href="#_1-7-1-" aria-label="Permalink to &quot;1.7.1 &quot;"></a></h3><ul><li> C 使</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> 60 - 70 <code></code><code></code><code></code><code></code> <code></code><code></code><code></code><code></code></p></div><h3 id="_1-7-2-" tabindex="-1">1.7.2 <a class="header-anchor" href="#_1-7-2-" aria-label="Permalink to &quot;1.7.2 &quot;"></a></h3><ul><li><p></p><ul><li> <code></code><code></code><code>0-9</code> <code>_</code> </li><li> <code></code></li><li> <code></code></li><li> <code></code> 63 </li><li> <code></code>Hellohello </li></ul></li><li><p></p><ul><li> 使sumnamemaxyear </li><li> 使线max_classes_per_student </li><li> 使线使 studentIdstudent_name </li><li> nameName </li><li> 使线C99 <code>_Bool</code>使线</li></ul></li><li><p></p></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>aBOOK_sunMAX_SIZEMousestudent23FootballFOOTBALLmax_addnum_1sum_of_numbers</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-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>$zj3sumab#cd23studentFoot-baiis.combcj**pbook-1tax ratedon&#39;t</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><h3 id="_1-7-3-" tabindex="-1">1.7.3 <a class="header-anchor" href="#_1-7-3-" aria-label="Permalink to &quot;1.7.3 &quot;"></a></h3><ul><li>C <code></code><code></code><code></code><code></code><code></code></li><li>C80 C90 ANSI C</li></ul><table tabindex="0"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td></td><td><code>char</code><code>double</code><code>float</code><code>int</code><code>long</code><code>short</code><code>signed</code><code>unsigned</code><code>void</code></td></tr><tr><td></td><td><code>auto</code><code>extern</code><code>register</code><code>static</code><code>typedef</code><code>volatile</code><code>const</code></td></tr><tr><td></td><td><code>break</code><code>case</code><code>continue</code><code>default</code><code>do</code><code>else</code><code>for</code><code>goto</code><code>if</code><code>return</code><code>switch</code><code>while</code></td></tr><tr><td></td><td><code>enum</code><code>struct</code><code>union</code></td></tr><tr><td></td><td><code>sizeof</code></td></tr></tbody></table><ul><li>C99 </li></ul><table tabindex="0"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td></td><td><code>_Bool</code><code>_Complex</code><code>_Imaginary</code></td></tr><tr><td></td><td><code>inline</code><code>restrict</code></td></tr><tr><td></td><td><code>_Complex</code> <code>_Imaginary</code></td></tr></tbody></table><ul><li>C11 </li></ul><table tabindex="0"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td></td><td><code>_Atomic</code></td></tr><tr><td></td><td><code>_Alignas</code> <code>_Alignof</code> <code>_Generic</code> <code>_Noreturn</code> <code>_Static_assert</code> <code>_Thread_local</code></td></tr></tbody></table><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li> </li><li> 使</li></ul></div><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></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li> <code>π</code> 3.1415926 </li><li> <code></code><code></code><code></code><code></code></li><li> ...</li></ul></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> C <ul><li> </li><li> <ul><li><code>#define</code> </li><li><code>const</code> </li><li></li></ul></li></ul></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>#define</code> <code>const</code> </li></ul></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>
<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>
@ -175,7 +204,7 @@ import{_ as s,c as i,o as a,a5 as n}from"./chunks/framework.BE8if9e6.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;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d\\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, sex);</span></span>
<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><span class="line-number">16</span><br></div></div><h2 id="_2-6-defind--vs-const-" tabindex="-1">2.6 #defind VS const <a class="header-anchor" href="#_2-6-defind--vs-const-" aria-label="Permalink to &quot;2.6 #defind VS const &quot;"></a></h2><ul><li> <code>#define</code> <code></code><code>const</code> <code></code></li><li> <code>#define</code> <code></code><code></code><code>const</code> <code></code><code></code></li></ul><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><ul><li><code></code><code></code><code></code><code></code><code></code></li></ul><p><img src="`+k+'" alt=""></p><ul><li><code>·</code> <ul><li> <strong></strong><code></code><code></code>使</li><li> <strong></strong><code></code></li><li> <strong></strong></li><li> <strong></strong><code></code><code></code><code></code><code></code><code></code></li><li> <strong></strong></li><li> <strong></strong>CPU</li></ul></li><li></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><h3 id="_3-2-1-" tabindex="-1">3.2.1 <a class="header-anchor" href="#_3-2-1-" aria-label="Permalink to &quot;3.2.1 &quot;"></a></h3><ul><li><code></code><code> 10 1</code> </li></ul><p><img src="'+r+`" alt=""></p><ul><li><code></code><code></code><code></code> <ul><li> 0 1 2 1 </li><li>0 ~ 7 8 1 </li><li>0 ~ 9 A ~ F 16 1 </li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> 0 9 便 9 A 10 B 11 F 15</p></div><ul><li></li></ul><table tabindex="0"><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody><tr><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>2</td><td>10</td><td>2</td><td>2</td></tr><tr><td>3</td><td>11</td><td>3</td><td>3</td></tr><tr><td>4</td><td>100</td><td>4</td><td>4</td></tr><tr><td>5</td><td>101</td><td>5</td><td>5</td></tr><tr><td>6</td><td>110</td><td>6</td><td>6</td></tr><tr><td>7</td><td>111</td><td>7</td><td>7</td></tr><tr><td>8</td><td>1000</td><td>10</td><td>8</td></tr><tr><td>9</td><td>1001</td><td>11</td><td>9</td></tr><tr><td>10</td><td>1010</td><td>12</td><td>a A</td></tr><tr><td>11</td><td>1011</td><td>13</td><td>b B</td></tr><tr><td>12</td><td>1100</td><td>14</td><td>c C</td></tr><tr><td>13</td><td>1101</td><td>15</td><td>d D</td></tr><tr><td>14</td><td>1110</td><td>16</td><td>e E</td></tr><tr><td>15</td><td>1111</td><td>17</td><td>f F</td></tr><tr><td>16</td><td>10000</td><td>20</td><td>10</td></tr><tr><td>...</td><td>...</td><td>...</td><td>...</td></tr></tbody></table><ul><li> 16 16 ( 2^4 ) 4 </li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>0 ~ F 0 ~ 150000 ~ 1111 0 ~ 15</p></div><ul><li> 4 </li></ul><table tabindex="0"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td>0</td><td>0000</td></tr><tr><td>1</td><td>0001</td></tr><tr><td>2</td><td>0010</td></tr><tr><td>3</td><td>0011</td></tr><tr><td>4</td><td>0100</td></tr><tr><td>5</td><td>0101</td></tr><tr><td>6</td><td>0110</td></tr><tr><td>7</td><td>0111</td></tr><tr><td>8</td><td>1000</td></tr><tr><td>9</td><td>1001</td></tr><tr><td>A</td><td>1010</td></tr><tr><td>B</td><td>1011</td></tr><tr><td>C</td><td>1100</td></tr><tr><td>D</td><td>1101</td></tr><tr><td>E</td><td>1110</td></tr><tr><td>F</td><td>1111</td></tr></tbody></table><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> 4 </p></div><ul><li> 8 8 ( 2^3 ) 3 </li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>0 ~ 7 000 ~ 111</p></div><ul><li> 3 </li></ul><table tabindex="0"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td>0</td><td>000</td></tr><tr><td>1</td><td>001</td></tr><tr><td>2</td><td>010</td></tr><tr><td>3</td><td>011</td></tr><tr><td>4</td><td>100</td></tr><tr><td>5</td><td>101</td></tr><tr><td>6</td><td>110</td></tr><tr><td>7</td><td>111</td></tr></tbody></table><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> 3 </p></div><h3 id="_3-2-2-c-" tabindex="-1">3.2.2 C <a class="header-anchor" href="#_3-2-2-c-" aria-label="Permalink to &quot;3.2.2 C &quot;"></a></h3><ul><li><p></p><ul><li> C <code></code> <code>0b</code> <code>0B</code> </li><li> C <code></code> <code>0</code> </li><li> C <code></code></li><li> C <code></code> <code>0x</code><code>0X</code> </li></ul></li><li><p></p></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><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></div></div><h2 id="_2-6-defind--vs-const-" tabindex="-1">2.6 #defind VS const <a class="header-anchor" href="#_2-6-defind--vs-const-" aria-label="Permalink to &quot;2.6 #defind VS const &quot;"></a></h2><ul><li> <code>#define</code> <code></code><code>const</code> <code></code></li><li> <code>#define</code> <code></code><code></code><code>const</code> <code></code><code></code></li></ul><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><ul><li><code></code><code></code><code></code><code></code><code></code></li></ul><p><img src="`+m+'" alt=""></p><ul><li><code>·</code> <ul><li> <strong></strong><code></code><code></code>使</li><li> <strong></strong><code></code></li><li> <strong></strong></li><li> <strong></strong><code></code><code></code><code></code><code></code><code></code></li><li> <strong></strong></li><li> <strong></strong>CPU</li></ul></li><li></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><h3 id="_3-2-1-" tabindex="-1">3.2.1 <a class="header-anchor" href="#_3-2-1-" aria-label="Permalink to &quot;3.2.1 &quot;"></a></h3><ul><li><code></code><code> 10 1</code> </li></ul><p><img src="'+C+`" alt=""></p><ul><li><code></code><code></code><code></code> <ul><li> 0 1 2 1 </li><li>0 ~ 7 8 1 </li><li>0 ~ 9 A ~ F 16 1 </li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> 0 9 便 9 A 10 B 11 F 15</p></div><ul><li></li></ul><table tabindex="0"><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody><tr><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>2</td><td>10</td><td>2</td><td>2</td></tr><tr><td>3</td><td>11</td><td>3</td><td>3</td></tr><tr><td>4</td><td>100</td><td>4</td><td>4</td></tr><tr><td>5</td><td>101</td><td>5</td><td>5</td></tr><tr><td>6</td><td>110</td><td>6</td><td>6</td></tr><tr><td>7</td><td>111</td><td>7</td><td>7</td></tr><tr><td>8</td><td>1000</td><td>10</td><td>8</td></tr><tr><td>9</td><td>1001</td><td>11</td><td>9</td></tr><tr><td>10</td><td>1010</td><td>12</td><td>a A</td></tr><tr><td>11</td><td>1011</td><td>13</td><td>b B</td></tr><tr><td>12</td><td>1100</td><td>14</td><td>c C</td></tr><tr><td>13</td><td>1101</td><td>15</td><td>d D</td></tr><tr><td>14</td><td>1110</td><td>16</td><td>e E</td></tr><tr><td>15</td><td>1111</td><td>17</td><td>f F</td></tr><tr><td>16</td><td>10000</td><td>20</td><td>10</td></tr><tr><td>...</td><td>...</td><td>...</td><td>...</td></tr></tbody></table><ul><li> 16 16 ( 2^4 ) 4 </li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>0 ~ F 0 ~ 150000 ~ 1111 0 ~ 15</p></div><ul><li> 4 </li></ul><table tabindex="0"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td>0</td><td>0000</td></tr><tr><td>1</td><td>0001</td></tr><tr><td>2</td><td>0010</td></tr><tr><td>3</td><td>0011</td></tr><tr><td>4</td><td>0100</td></tr><tr><td>5</td><td>0101</td></tr><tr><td>6</td><td>0110</td></tr><tr><td>7</td><td>0111</td></tr><tr><td>8</td><td>1000</td></tr><tr><td>9</td><td>1001</td></tr><tr><td>A</td><td>1010</td></tr><tr><td>B</td><td>1011</td></tr><tr><td>C</td><td>1100</td></tr><tr><td>D</td><td>1101</td></tr><tr><td>E</td><td>1110</td></tr><tr><td>F</td><td>1111</td></tr></tbody></table><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> 4 </p></div><ul><li> 8 8 ( 2^3 ) 3 </li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>0 ~ 7 000 ~ 111</p></div><ul><li> 3 </li></ul><table tabindex="0"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td>0</td><td>000</td></tr><tr><td>1</td><td>001</td></tr><tr><td>2</td><td>010</td></tr><tr><td>3</td><td>011</td></tr><tr><td>4</td><td>100</td></tr><tr><td>5</td><td>101</td></tr><tr><td>6</td><td>110</td></tr><tr><td>7</td><td>111</td></tr></tbody></table><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> 3 </p></div><h3 id="_3-2-2-c-" tabindex="-1">3.2.2 C <a class="header-anchor" href="#_3-2-2-c-" aria-label="Permalink to &quot;3.2.2 C &quot;"></a></h3><ul><li><p></p><ul><li> C <code></code> <code>0b</code> <code>0B</code> </li><li> C <code></code> <code>0</code> </li><li> C <code></code></li><li> C <code></code> <code>0x</code><code>0X</code> </li></ul></li><li><p></p></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>
@ -204,4 +233,4 @@ import{_ as s,c as i,o as a,a5 as n}from"./chunks/framework.BE8if9e6.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;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%#X\\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, num, num);</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 100 0X64</span></span>
<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><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></ul><p><img src="`+c+'" alt=""></p><ul><li></li></ul><p><img src="'+o+'" alt=""></p><h3 id="_3-3-2-" tabindex="-1">3.3.2 <a class="header-anchor" href="#_3-3-2-" aria-label="Permalink to &quot;3.3.2 &quot;"></a></h3><h4 id="_3-3-2-1-" tabindex="-1">3.3.2.1 <a class="header-anchor" href="#_3-3-2-1-" aria-label="Permalink to &quot;3.3.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="'+E+'" alt=""></p><ul><li></li></ul><p><img src="'+u+'" alt=""></p><h4 id="_3-3-2-2-" tabindex="-1">3.3.2.2 <a class="header-anchor" href="#_3-3-2-2-" aria-label="Permalink to &quot;3.3.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="'+b+'" alt=""></p><ul><li></li></ul><p><img src="'+g+'" alt=""></p><h3 id="_3-3-3-" tabindex="-1">3.3.3 <a class="header-anchor" href="#_3-3-3-" aria-label="Permalink to &quot;3.3.3 &quot;"></a></h3><ul><li><p> 3 </p></li><li><p>011 101 001 -&gt; 351</p></li></ul><p><img src="'+F+'" alt=""></p><h3 id="_3-3-4-" tabindex="-1">3.3.4 <a class="header-anchor" href="#_3-3-4-" aria-label="Permalink to &quot;3.3.4 &quot;"></a></h3><ul><li><p> 4 </p></li><li><p>1110 1001 -&gt; 0xE9</p></li></ul><p><img src="'+y+'" alt=""></p><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>0 1 </li></ul><p><img src="'+m+'" alt=""></p><ul><li> 1000 0001 -1 129 </li></ul><p><img src="'+C+'" 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><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-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></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-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></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="'+B+'" alt=""></p><ul><li> 0 <code>-0</code> </li></ul><p><img src="'+v+'" 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-4-5-" tabindex="-1">3.4.5 <a class="header-anchor" href="#_3-4-5-" aria-label="Permalink to &quot;3.4.5 &quot;"></a></h3><ul><li> </li><li> 0 1 1 0 + 1 </li><li> 0 0 </li></ul><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><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="'+A+'" alt=""></p><ul><li><code></code><code></code><code></code></li></ul><p><img src="'+_+'" alt=""></p>',190),f=[q];function x(P,T,N,O,w,I){return a(),i("div",null,f)}const L=s(D,[["render",x]]);export{S as __pageData,L as default};
<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><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></ul><p><img src="`+B+'" alt=""></p><ul><li></li></ul><p><img src="'+v+'" alt=""></p><h3 id="_3-3-2-" tabindex="-1">3.3.2 <a class="header-anchor" href="#_3-3-2-" aria-label="Permalink to &quot;3.3.2 &quot;"></a></h3><h4 id="_3-3-2-1-" tabindex="-1">3.3.2.1 <a class="header-anchor" href="#_3-3-2-1-" aria-label="Permalink to &quot;3.3.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="'+A+'" alt=""></p><ul><li></li></ul><p><img src="'+D+'" alt=""></p><h4 id="_3-3-2-2-" tabindex="-1">3.3.2.2 <a class="header-anchor" href="#_3-3-2-2-" aria-label="Permalink to &quot;3.3.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="'+_+'" alt=""></p><ul><li></li></ul><p><img src="'+q+'" alt=""></p><h3 id="_3-3-3-" tabindex="-1">3.3.3 <a class="header-anchor" href="#_3-3-3-" aria-label="Permalink to &quot;3.3.3 &quot;"></a></h3><ul><li><p> 3 </p></li><li><p>011 101 001 -&gt; 351</p></li></ul><p><img src="'+f+'" alt=""></p><h3 id="_3-3-4-" tabindex="-1">3.3.4 <a class="header-anchor" href="#_3-3-4-" aria-label="Permalink to &quot;3.3.4 &quot;"></a></h3><ul><li><p> 4 </p></li><li><p>1110 1001 -&gt; 0xE9</p></li></ul><p><img src="'+x+'" alt=""></p><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>0 1 </li></ul><p><img src="'+P+'" alt=""></p><ul><li> 1000 0001 -1 129 </li></ul><p><img src="'+O+'" 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><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-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></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-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></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="'+T+'" alt=""></p><ul><li> 0 <code>-0</code> </li></ul><p><img src="'+N+'" 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>`</li><li> <code></code><code></code><code></code></li></ul></div><h3 id="_3-4-5-" tabindex="-1">3.4.5 <a class="header-anchor" href="#_3-4-5-" aria-label="Permalink to &quot;3.4.5 &quot;"></a></h3><ul><li> </li><li> 0 1 1 0 + 1 </li><li> 0 0 </li></ul><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><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="'+M+'" alt=""></p><ul><li><code></code><code></code><code></code></li></ul><p><img src="'+w+'" alt=""></p>',244),R=[U];function L(S,X,z,j,V,H){return a(),i("div",null,R)}const Q=s(I,[["render",L]]);export{K as __pageData,Q as default};

View File

@ -0,0 +1 @@
import{_ as s,c as i,o as a,a5 as n}from"./chunks/framework.BE8if9e6.js";const l="/c/assets/1.CXNJqOOc.png",e="/c/assets/2.E0LS08Y5.png",t="/c/assets/3.6recRAvz.jpeg",p="/c/assets/4.DcyDw4rB.jpg",h="/c/assets/5.q20QOAIA.png",d="/c/assets/6.CmrWpBzQ.png",k="/c/assets/7.CocAjZjO.png",r="/c/assets/8.CHZSlb-7.png",c="/c/assets/9.RD2M_pYn.png",o="/c/assets/10.CmNKK_Ug.png",u="/c/assets/11.CbGZ55Dj.png",E="/c/assets/12.DpTBR420.png",b="/c/assets/13.XcPl7d9s.png",g="/c/assets/14.DL02VQMp.png",F="/c/assets/15.Dr67r_Ws.png",y="/c/assets/16.C5XiXNVN.png",m="/c/assets/17.DO8XxSV6.jpg",C="/c/assets/18.CUXrdefp.jpeg",B="/c/assets/19.uqLiL_yu.png",v="/c/assets/20.CkykpHY2.png",A="/c/assets/21.DV1YbrOP.png",D="/c/assets/22.AHNJT9TV.png",_="/c/assets/23.Bs-MOwx2.png",q="/c/assets/24.StzjmBz-.png",f="/c/assets/25.C0wVWaxD.png",x="/c/assets/26.LXJMAihe.png",P="/c/assets/27._UTCq3PD.png",O="/c/assets/28.BjQ5kBL-.png",T="/c/assets/29.COIOzcmT.png",N="/c/assets/30.Cu__mjav.png",M="/c/assets/31.BX_KzkHt.png",w="/c/assets/32.COt_QxSP.png",K=JSON.parse('{"title":"第一章:变量(⭐)","description":"","frontmatter":{},"headers":[],"relativePath":"notes/01_c-basic/02_xdx/index.md","filePath":"notes/01_c-basic/02_xdx/index.md","lastUpdated":1721028373000}'),I={name:"notes/01_c-basic/02_xdx/index.md"},U=n("",244),R=[U];function L(S,X,z,j,V,H){return a(),i("div",null,R)}const Q=s(I,[["render",L]]);export{K as __pageData,Q as default};

View File

@ -1 +0,0 @@
import{_ as s,c as i,o as a,a5 as n}from"./chunks/framework.BE8if9e6.js";const l="/c/assets/1.CXNJqOOc.png",e="/c/assets/2.E0LS08Y5.png",t="/c/assets/3.XcPl7d9s.png",p="/c/assets/4.DL02VQMp.png",h="/c/assets/5.Dr67r_Ws.png",d="/c/assets/6.C5XiXNVN.png",k="/c/assets/7.DO8XxSV6.jpg",r="/c/assets/8.CUXrdefp.jpeg",c="/c/assets/9.uqLiL_yu.png",o="/c/assets/10.CkykpHY2.png",E="/c/assets/11.DV1YbrOP.png",u="/c/assets/12.AHNJT9TV.png",b="/c/assets/13.Bs-MOwx2.png",g="/c/assets/14.StzjmBz-.png",F="/c/assets/15.C0wVWaxD.png",y="/c/assets/16.LXJMAihe.png",m="/c/assets/17._UTCq3PD.png",C="/c/assets/18.BjQ5kBL-.png",B="/c/assets/19.COIOzcmT.png",v="/c/assets/20.Cu__mjav.png",A="/c/assets/21.BX_KzkHt.png",_="/c/assets/22.COt_QxSP.png",S=JSON.parse('{"title":"第一章:变量(⭐)","description":"","frontmatter":{},"headers":[],"relativePath":"notes/01_c-basic/02_xdx/index.md","filePath":"notes/01_c-basic/02_xdx/index.md","lastUpdated":1720685105000}'),D={name:"notes/01_c-basic/02_xdx/index.md"},q=n("",190),f=[q];function x(P,T,N,O,w,I){return a(),i("div",null,f)}const L=s(D,[["render",x]]);export{S as __pageData,L as default};

View File

@ -1 +1 @@
{"notes_index.md":"CdHKXnBk","notes_01_c-basic_01_xdx_index.md":"DA3nuW_4","notes_01_c-basic_02_xdx_index.md":"Cux_q1Jy","index.md":"uFk6fSzW"}
{"index.md":"uFk6fSzW","notes_index.md":"CdHKXnBk","notes_01_c-basic_02_xdx_index.md":"CB8oZG6k","notes_01_c-basic_01_xdx_index.md":"DA3nuW_4"}

View File

@ -8,10 +8,10 @@
<meta name="generator" content="VitePress v1.2.3">
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
<script type="module" src="/c/assets/app.NavY-WoM.js"></script>
<script type="module" src="/c/assets/app.DJvpVQC4.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/framework.BE8if9e6.js">
<link rel="modulepreload" href="/c/assets/chunks/theme.Dwe0RGAL.js">
<link rel="modulepreload" href="/c/assets/chunks/theme.C4MahGFn.js">
<link rel="modulepreload" href="/c/assets/index.md.uFk6fSzW.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">
@ -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-ccf7ddec><div class="wrapper" data-v-ccf7ddec><div class="container" data-v-ccf7ddec><div class="title" data-v-ccf7ddec><div class="VPNavBarTitle" data-v-ccf7ddec 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-ccf7ddec><div class="content-body" data-v-ccf7ddec><!--[--><!--]--><div class="VPNavBarSearch search" data-v-ccf7ddec><!--[--><!----><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-ccf7ddec data-v-7f418b0f><span id="main-nav-aria-label" class="visually-hidden" data-v-7f418b0f>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-7f418b0f 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-7f418b0f data-v-9c663999><!--[--><span data-v-9c663999>计组6件套</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/c/notes/" tabindex="0" data-v-7f418b0f data-v-9c663999><!--[--><span data-v-9c663999>c/c++</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/web-design/notes/" target="_blank" rel="noreferrer" tabindex="0" data-v-7f418b0f data-v-9c663999><!--[--><span data-v-9c663999>前端</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/java/notes/" target="_blank" rel="noreferrer" tabindex="0" data-v-7f418b0f data-v-9c663999><!--[--><span data-v-9c663999>Java</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/big-data/notes/" target="_blank" rel="noreferrer" tabindex="0" data-v-7f418b0f data-v-9c663999><!--[--><span data-v-9c663999>大数据</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/linux/notes/" target="_blank" rel="noreferrer" tabindex="0" data-v-7f418b0f data-v-9c663999><!--[--><span data-v-9c663999>云原生</span><!--]--></a><!--]--><!--[--><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-7f418b0f data-v-9c663999><!--[--><span data-v-9c663999>开源软件</span><!--]--></a><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-ccf7ddec data-v-e6aabb21><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-e6aabb21 data-v-d1f28634 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-d1f28634></span><span class="vpi-moon moon" data-v-d1f28634></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-ccf7ddec 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-ccf7ddec data-v-d0bd9dde 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-e7ea1737><!----><!--[--><!--[--><!----><div class="group" data-v-d0bd9dde><div class="item appearance" data-v-d0bd9dde><p class="label" data-v-d0bd9dde>Appearance</p><div class="appearance-action" data-v-d0bd9dde><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-d0bd9dde data-v-d1f28634 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-d1f28634></span><span class="vpi-moon moon" data-v-d1f28634></span><!--]--></span></span></button></div></div></div><div class="group" data-v-d0bd9dde><div class="item social-links" data-v-d0bd9dde><div class="VPSocialLinks social-links-list" data-v-d0bd9dde 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-ccf7ddec 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-ccf7ddec><div class="divider-line" data-v-ccf7ddec></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><!--[--><!--]--></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("{\"notes_index.md\":\"CdHKXnBk\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cux_q1Jy\",\"index.md\":\"uFk6fSzW\"}");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\":\"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\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"初识 C 语言\",\"link\":\"/notes/02_dsa/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]}]},\"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\":\"uFk6fSzW\",\"notes_index.md\":\"CdHKXnBk\",\"notes_01_c-basic_02_xdx_index.md\":\"CB8oZG6k\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\"}");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\":\"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\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"初识 C 语言\",\"link\":\"/notes/02_dsa/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]}]},\"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,10 +8,10 @@
<meta name="generator" content="VitePress v1.2.3">
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
<script type="module" src="/c/assets/app.NavY-WoM.js"></script>
<script type="module" src="/c/assets/app.DJvpVQC4.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/framework.BE8if9e6.js">
<link rel="modulepreload" href="/c/assets/chunks/theme.Dwe0RGAL.js">
<link rel="modulepreload" href="/c/assets/chunks/theme.C4MahGFn.js">
<link rel="modulepreload" href="/c/assets/notes_01_c-basic_01_xdx_index.md.DA3nuW_4.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">
@ -246,7 +246,7 @@
<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="_7-6-演示" tabindex="-1">7.6 演示 <a class="header-anchor" href="#_7-6-演示" aria-label="Permalink to &quot;7.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/158.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="_8-1-概述" tabindex="-1">8.1 概述 <a class="header-anchor" href="#_8-1-概述" aria-label="Permalink to &quot;8.1 概述&quot;"></a></h2><ul><li>C 程序的编译过程,如下所示:</li></ul><p><img src="/c/assets/159.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="_8-2-gcc-编译器的介绍" tabindex="-1">8.2 GCC 编译器的介绍 <a class="header-anchor" href="#_8-2-gcc-编译器的介绍" aria-label="Permalink to &quot;8.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="_8-3-通过-gcc-直接生成可执行文件" tabindex="-1">8.3 通过 gcc 直接生成可执行文件 <a class="header-anchor" href="#_8-3-通过-gcc-直接生成可执行文件" aria-label="Permalink to &quot;8.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/160.6yQYnjOa.gif" alt=""></p><h2 id="_8-4-通过-gcc-分步编译" tabindex="-1">8.4 通过 gcc 分步编译 <a class="header-anchor" href="#_8-4-通过-gcc-分步编译" aria-label="Permalink to &quot;8.4 通过 gcc 分步编译&quot;"></a></h2><h3 id="_8-3-1-概述" tabindex="-1">8.3.1 概述 <a class="header-anchor" href="#_8-3-1-概述" aria-label="Permalink to &quot;8.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="_8-4-2-应用示例" tabindex="-1">8.4.2 应用示例 <a class="header-anchor" href="#_8-4-2-应用示例" aria-label="Permalink to &quot;8.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/161.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/162.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/163.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/164.BToOkxf2.gif" alt=""></p></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-d4a0bba5><!--[--><!--]--><div class="edit-info" data-v-d4a0bba5><!----><div class="last-updated" data-v-d4a0bba5><p class="VPLastUpdated" data-v-d4a0bba5 data-v-7e05ebdb>上次更新: <time datetime="2024-07-11T08:05:05.000Z" data-v-7e05ebdb></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-d4a0bba5><span class="visually-hidden" id="doc-footer-aria-label" data-v-d4a0bba5>Pager</span><div class="pager" data-v-d4a0bba5><!----></div><div class="pager" data-v-d4a0bba5><a class="VPLink link pager-link next" href="/c/notes/01_c-basic/02_xdx/" data-v-d4a0bba5><!--[--><span class="desc" data-v-d4a0bba5>下一篇</span><span class="title" data-v-d4a0bba5>变量和进制</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("{\"notes_index.md\":\"CdHKXnBk\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cux_q1Jy\",\"index.md\":\"uFk6fSzW\"}");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\":\"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\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"初识 C 语言\",\"link\":\"/notes/02_dsa/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]}]},\"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\":\"uFk6fSzW\",\"notes_index.md\":\"CdHKXnBk\",\"notes_01_c-basic_02_xdx_index.md\":\"CB8oZG6k\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\"}");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\":\"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\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"初识 C 语言\",\"link\":\"/notes/02_dsa/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]}]},\"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.2.3">
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
<script type="module" src="/c/assets/app.NavY-WoM.js"></script>
<script type="module" src="/c/assets/app.DJvpVQC4.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/framework.BE8if9e6.js">
<link rel="modulepreload" href="/c/assets/chunks/theme.Dwe0RGAL.js">
<link rel="modulepreload" href="/c/assets/notes_01_c-basic_02_xdx_index.md.Cux_q1Jy.lean.js">
<link rel="modulepreload" href="/c/assets/chunks/theme.C4MahGFn.js">
<link rel="modulepreload" href="/c/assets/notes_01_c-basic_02_xdx_index.md.CB8oZG6k.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="许大仙,许大仙的博客">
@ -57,9 +57,16 @@
<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;c3 = </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, c3);</span></span>
<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></div></div><h2 id="_1-4-输出变量" tabindex="-1">1.4 输出变量 <a class="header-anchor" href="#_1-4-输出变量" aria-label="Permalink to &quot;1.4 输出变量&quot;"></a></h2><ul><li>在计算机中,所谓的<code>输入</code><code>输出</code>都是以计算机CPU 和内存)为主体而言的,即:</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>输入:从输入设备(键盘、鼠标、扫描仪)向计算机输入数据。</p><p>输出:从计算机向外部输出设备(显示器、打印机)输出数据。</p></div><p><img src="/c/assets/3.XcPl7d9s.png" alt=""></p><ul><li>在 C 语言中,提供了 <code>printf()</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;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> char</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">__format</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></div></div><h2 id="_1-4-从计算机底层看变量" tabindex="-1">1.4 从计算机底层看变量 <a class="header-anchor" href="#_1-4-从计算机底层看变量" aria-label="Permalink to &quot;1.4 从计算机底层看变量&quot;"></a></h2><h3 id="_1-4-1-内存条的内部结构" tabindex="-1">1.4.1 内存条的内部结构 <a class="header-anchor" href="#_1-4-1-内存条的内部结构" aria-label="Permalink to &quot;1.4.1 内存条的内部结构&quot;"></a></h3><ul><li>如果只看内存条的外观,无非就是一些集成电路和颗粒而已,如下所示:</li></ul><p><img src="/c/assets/3.6recRAvz.jpeg" alt=""></p><ul><li>并且,我们只需要将内存条插入到计算机主板对应的内存条插槽上,就可以正常工作,如下所示:</li></ul><p><img src="/c/assets/4.DcyDw4rB.jpg" alt=""></p><ul><li>在家用的台式机主板上,通常有 4 个插槽或 2 个插槽,例如:本人的计算机就支持 4 个插槽,如下所示:</li></ul><p><img src="/c/assets/5.q20QOAIA.png" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 上图中的外形规格是 DIMM所以我们通常也以 DIMM 也表示内存条。</li><li>② DIMM 是内存条的物理形式,安装在主板的内存插槽中。</li><li>③ 常见的 DIMM 类型包括 UDIMM非缓冲 DIMM、RDIMM缓冲 DIMM和 LRDIMM负载减少DIMM</li></ul></div><ul><li>我们可以通过 <a href="https://www.cpuid.com/" target="_blank" rel="noreferrer">CPU-Z</a> 这个软件,查看 CPU 的一些指标信息,如下所示:</li></ul><p><img src="/c/assets/6.CmrWpBzQ.png" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 通过 CPU-Z 表明本人的台式机是支持双通道的,<code>channel</code><code>计算机</code>中可以<code>翻译</code><code>信道</code><code>通道</code></li><li>② 通道是内存控制器与内存模块之间的通信路径。</li><li>③ 多通道内存可以提高数据传输带宽。例如:双通道内存系统同时使用两个通道来传输数据,从而提高性能。</li><li>④ 现代主板通常支持双通道Dual Channel、四通道Quad Channel甚至八通道Octa Channel</li></ul></div><ul><li>对于家用台式机而言,如果将内存条的插槽从左到右依次编号,如下所示:</li></ul><p><img src="/c/assets/7.CocAjZjO.png" alt=""></p><ul><li>其中,<code>槽1</code><code>槽2</code> 是一个通道,<code>槽3</code><code>槽4</code> 是一个通道;所以,通常是这么建议的: <ul><li>如果只有 1 根内存条,就插到 <code>槽2</code> 中。</li><li>如果有 2 根内存条,就分别插入到 <code>槽2</code><code>槽4</code> 中。</li><li>如果有 4 根内存条,就全插满即可。</li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>组成双通道配置的内存条需要遵循一些基本要求来确保它们能够正常以双通道模式运行:</p><ul><li><strong>相同容量</strong>:理想情况下,组成双通道的内存条应该具有相同的容量。这样可以确保它们在处理数据时的一致性和兼容性。</li><li><strong>匹配的速度规格</strong>内存条应该具有相同的速度规格即它们的频率DDR4-2400、DDR4-3200等应该相同。不同速度的内存条可以一起工作但系统会以所有内存条中最慢的那个的速度运行。</li><li><strong>相同的时序</strong>内存条的时序CL16-18-18-38应该匹配。时序参数影响内存的响应速度和稳定性不匹配的时序可能会降低性能或导致系统不稳定。</li><li><strong>相同的制造商和型号</strong>(推荐):虽然不是强制性要求,但选择相同制造商和型号的内存条可以最大限度地减少兼容性问题。不同制造商的内存条可能在微小的规格和性能上有差异,这有可能影响双通道配置的效能。</li></ul></div><ul><li>内存条表面会有内存颗粒,如下所示:</li></ul><p><img src="/c/assets/8.CHZSlb-7.png" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>上图中的内存条有 8 个内存颗粒;但是,高端服务器上的内存条通常会存在 9 个内存颗粒,最后 1 个内存颗粒专门用来做 ECC 校验。</p></div><ul><li>一个内存条有两面,高端的内存条两面都有内存颗粒,我们将每个面称为 Rank 。那么,如果内存条有两个面,就是存在 Rank0 和 Rank1 ,即:</li></ul><p><img src="/c/assets/9.RD2M_pYn.png" alt=""></p><ul><li>内存条表面的黑色颗粒,我们称为 chip芯片 ,即:</li></ul><p><img src="/c/assets/10.CmNKK_Ug.png" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 内存颗粒是内存条上的 DRAM 芯片,每个芯片包含多个存储单元。</li><li>② 内存颗粒存储数据并与内存控制器进行数据交换。</li></ul></div><ul><li>在 chip 中还有 8 个 bank每个 bank 就是数据存储的实体,这些 bank 组成了一个二维矩阵,只要声明了 column 和 row 就可以从每个 bank 中取出 8bit 1 Bytes的数据如下所示</li></ul><p><img src="/c/assets/11.CbGZ55Dj.png" alt="img"></p><ul><li>综上所示,内存条的分层结构就是 <code>Channel &gt; DIMM &gt; Rank -&gt; Chip -&gt; Bank -&gt; Row/Column</code></li></ul><h3 id="_1-4-2-变量的作用" tabindex="-1">1.4.2 变量的作用 <a class="header-anchor" href="#_1-4-2-变量的作用" aria-label="Permalink to &quot;1.4.2 变量的作用&quot;"></a></h3><ul><li><p>如果我们希望计算 10 和 20 的和;那么,在计算机中需要怎么做?</p><ul><li>① 首先,计算 10 和 20 的运算,一定在 CPU 中进行,因为在计算机中的各个部件中,只有 CPU 有运算器ALU</li><li>② 其次,我们需要将 10 和 20 交给 CPU ;由于 CPU 只能和内存进行交互,那么我们必须将 10 和 20 存储到内存中。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>即使 10 和 20 是存储在文件中的,也需要先加载进内存,然后再交给 CPU 进行运算。</p></div><ul><li>③ 最后,只需要告诉 CPU 做何种运算,如:加、减、乘、除等。</li></ul></li><li><p>其中,最为重要的问题就是如何将数据存储到内存中?答案就是通过<code>变量</code></p></li></ul><p><img src="/c/assets/12.DpTBR420.png" alt=""></p><ul><li>我们知道,计算机底层是使用二进制来表示指令和数据的;但是,如果我们的代码都是这样的,即:</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>来编写代码(机器语言)实现是太难阅读、修改和维护了;于是,我们就使用了汇编语言来编写代码,并通过编译器来将汇编语言翻译为机器语言,即:</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>LOAD A, 16 -- 编译 --&gt; 0000,0000,000000010000</span></span>
<span class="line"><span>LOAD B, 1 -- 编译 --&gt; 0000,0001,000000000001</span></span>
<span class="line"><span>STORE B, 16 -- 编译 --&gt; 0001,0001,000000010000</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>但是,这样的汇编语言还是面向机器的,编程时仍然需要记住和管理大量内存地址,不具备程序的移植性;于是,我们就是使用了高级语言来编写代码,并引入了变量的概念,即:</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;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> num </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 10</span><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></div></div><ul><li><p>我们使用<code>变量名</code><code>关联</code>内存<code>地址</code>,这样我们在编写代码的时候,就可以不用直接操作内存地址,极大地提高了代码的可读性和开发效率。并且,当程序运行完毕之后,程序所占用的内存还会交还给操作系统,以便其它程序使用。</p></li><li><p>综上所述,高级语言编译器的作用就是:</p><ul><li>① 编写源代码时使用变量名。</li><li>② 程序在经过编译器的编译之后,所有变量名被替换为具体地址。</li><li>③ ……</li></ul></li><li><p>此时,我们就可以知道,<code>变量</code>就是内存中用于<code>存储数据</code><code>临时空间</code>,并且变量中的值是可以变化的。</p></li><li><p><code>内存</code>中空间的<code>最小单位</code><code>字节</code>Bytes即 8 个 0 或 1 ,如下所示:</p></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>00011001 00100110 00100110 00100110 00100110 ...</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>计算机中存储单位的换算,如下所示:</p><ul><li>1 B = 8 bit。</li><li>1 KB = 1024 B。</li><li>1 MB = 1024 KB。</li><li>1 GB = 1024 MB。</li><li>1 TB = 1024 GB 。</li><li>……</li></ul></div><ul><li>在内存中,每一个字节都有一个编号,这个编号我们称之为地址。一个变量至少占用 1 个字节1 个或多个字节我们将变量的第一个字节所占用的地址变量的首地址就称之为该变量的地址。CPU 就可以通过变量地址找到某个变量的值,然后拿到具体的数据进行计算了。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>变量就是保存程序运行过程中临时产生的值。</p></div><ul><li><p>其实,到这里还是有疑惑的?我们说过,一个变量至少会占用 1 个字节,如果一个变量占用了 4 个字节,而 CPU 只会通过变量的地址(首地址)获取数据,那么 CPU 是如何获取完整的数据的?答案就是通过<code>数据类型</code>,数据类型除了限制数据的种类,还限制了数据在内存中所占空间的大小,如上图所示:</p><ul><li>① 假设变量 <code>a</code> 的首地址是 <code>01</code> ,变量的数据类型是 <code>4</code> 个字节。</li><li>② 那么CPU 就会依次,从 <code>01 ~ 04</code> 中获取数据。</li></ul></li><li><p>再次,剖析下变量的语法格式:</p></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>数据类型 变量名 = 值;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><ul><li><code>变量名</code><code>作用</code>,如下所示: <ul><li>① 当我们<code>编写</code>代码的时候,使用<code>变量名</code><code>关联</code>某块内存的<code>地址</code></li><li>② 当 CPU <code>执行</code>的时候,会将变量名<code>替换</code>为具体的地址,再进行具体的操作。</li></ul></li></ul><div class="caution custom-block github-alert"><p class="custom-block-title">CAUTION</p><p></p><p>变量名(标识符)需要符合命名规则和命名规范!!!</p></div><ul><li><p><code>数据类型</code><code>作用</code>,如下所示:</p><ul><li>① 变量的数据类型<code>决定了</code>变量所占空间的大小。当我们在声明变量的时候写了数据数据类型CPU 就知道从变量的首地址位置开始取多少字节。</li><li>② 变量的数据类型<code>决定了</code>两个变量是否能够运行以及能够做何种运算。例如JavaScript 就没有 char 类型的变量,都是 string 类型,可以和任意数据类型的数据拼接,并转换为 string 类型Java 中有 char 类型的变量,底层都会转换 unicode 编码,然后再计算。</li></ul></li><li><p><code></code><code>作用</code>,如下所示:</p><ul><li><code></code>就是<code>内存</code><code>实际存储</code><code>数据</code></li><li><code>=</code> 是赋值操作符,就是将等号右侧的数据存储到等号左侧的变量名所代表的内存空间。</li></ul></li><li><p>那么,如下代码的含义就是:</p></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;">// int 数据类型4 个字节</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// num 变量名 -- 关联内存中的一块存储空间</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// = 10 将 10 存储到 num 所代表的 4 个字节的存储空间中</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> num </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 10</span><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></div></div><h2 id="_1-6-变量的重要操作" tabindex="-1">1.6 变量的重要操作 <a class="header-anchor" href="#_1-6-变量的重要操作" aria-label="Permalink to &quot;1.6 变量的重要操作&quot;"></a></h2><h3 id="_1-6-1-变量的输出" tabindex="-1">1.6.1 变量的输出 <a class="header-anchor" href="#_1-6-1-变量的输出" aria-label="Permalink to &quot;1.6.1 变量的输出&quot;"></a></h3><ul><li>在计算机中,所谓的<code>输入</code><code>输出</code>都是以计算机CPU 和内存)为主体而言的,即:</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>输入:从输入设备(键盘、鼠标、扫描仪)向计算机输入数据。</p><p>输出:从计算机向外部输出设备(显示器、打印机)输出数据。</p></div><p><img src="/c/assets/13.XcPl7d9s.png" alt=""></p><ul><li>在 C 语言中,提供了 <code>printf()</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;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> char</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">__format</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, ...) {</span></span>
<span class="line"><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></div></div><ul><li><code>printf</code> 的标准含义是格式化输出文本,来源于 <code>print formatted格式化打印</code>的缩写,其语法规则,如下所示:</li></ul><p><img src="/c/assets/4.DL02VQMp.png" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>格式化字符串:是使用双引号括起来的字符串,里面包含了普通的字符串和格式占位符。</li><li>格式占位符(格式声明符):由 <code>%</code><code>格式字符</code>组成,作用是将输出的数据转换为指定的格式后输出,这里的 <code>%d</code> 表示整数。</li><li>输出列表:是程序要输出的一些数据,可以是常量、变量或表达式,需要和格式占位符一一对应。</li></ul></div><ul><li><p>在计算机中,二进制、八进制、十进制以及十六进制的英文名称和缩写,如下所示:</p><ul><li>二进制binary缩写是 bin。</li><li>八进制octal缩写是 oct。</li><li>十进制decimal缩写是 dec。</li><li>十六进制Hexadecimal缩写是 hex。</li></ul></li><li><p>其实,我们也可以在 Windows 系统中的计算器中来看到,即:</p></li></ul><p><img src="/c/assets/5.Dr67r_Ws.png" alt=""></p><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>在生活中的 decimal 是小数的意思;但是,在 C 语言中decimal 的完整含义是 decimal integer ,即十进制整数。</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>
<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></div></div><ul><li><code>printf</code> 的标准含义是格式化输出文本,来源于 <code>print formatted格式化打印</code>的缩写,其语法规则,如下所示:</li></ul><p><img src="/c/assets/14.DL02VQMp.png" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>格式化字符串:是使用双引号括起来的字符串,里面包含了普通的字符串和格式占位符。</li><li>格式占位符(格式声明符):由 <code>%</code><code>格式字符</code>组成,作用是将输出的数据转换为指定的格式后输出,这里的 <code>%d</code> 表示整数。</li><li>输出列表:是程序要输出的一些数据,可以是常量、变量或表达式,需要和格式占位符一一对应。</li></ul></div><ul><li><p>在计算机中,二进制、八进制、十进制以及十六进制的英文名称和缩写,如下所示:</p><ul><li>二进制binary缩写是 bin。</li><li>八进制octal缩写是 oct。</li><li>十进制decimal缩写是 dec。</li><li>十六进制Hexadecimal缩写是 hex。</li></ul></li><li><p>其实,我们也可以在 Windows 系统中的计算器中来看到,即:</p></li></ul><p><img src="/c/assets/15.Dr67r_Ws.png" alt=""></p><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>在生活中的 decimal 是小数的意思;但是,在计算机decimal 的完整含义是 decimal integer ,即十进制整数。</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>
<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>
@ -70,9 +77,31 @@
<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;我今年</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, num);</span></span>
<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></div></div><h2 id="_1-5-输入数据赋值给变量" tabindex="-1">1.5 输入数据赋值给变量 <a class="header-anchor" href="#_1-5-输入数据赋值给变量" aria-label="Permalink to &quot;1.5 输入数据赋值给变量&quot;"></a></h2><ul><li>在 C 语言中,提供了 <code>scanf()</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;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> scanf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> char</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">__format</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></div></div><h3 id="_1-6-2-计算变量的大小" tabindex="-1">1.6.2 计算变量的大小 <a class="header-anchor" href="#_1-6-2-计算变量的大小" aria-label="Permalink to &quot;1.6.2 计算变量的大小&quot;"></a></h3><ul><li><p>我们可以使用 <code>sizeof</code>关键字(运算符)来计算变量或类型所占内存空间的大小。</p></li><li><p>示例:</p></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>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> num </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 10</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<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;变量所占内存空间的大小:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%zd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">字节</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\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;">sizeof</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(num));</span></span>
<span class="line"></span>
<span class="line"><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;数据类型所占内存空间的大小:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%zd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">字节</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\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;">sizeof</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">));</span></span>
<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></div></div><h3 id="_1-6-3-获取变量的地址" tabindex="-1">1.6.3 获取变量的地址 <a class="header-anchor" href="#_1-6-3-获取变量的地址" aria-label="Permalink to &quot;1.6.3 获取变量的地址&quot;"></a></h3><ul><li><p>在 C 语言中,我们可以使用<code>取地址运算符 &amp;</code> 来获取变量的地址。</p></li><li><p>示例:</p></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>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> num </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 10</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<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;变量 num 的值是:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, num);</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;变量 num 的地址(指针)是:</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:#24292E;--shiki-dark:#E1E4E8;">num);</span></span>
<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><h3 id="_1-6-4-变量的输入" tabindex="-1">1.6.4 变量的输入 <a class="header-anchor" href="#_1-6-4-变量的输入" aria-label="Permalink to &quot;1.6.4 变量的输入&quot;"></a></h3><ul><li>在 C 语言中,提供了 <code>scanf()</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;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> scanf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> char</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">__format</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, ...) {</span></span>
<span class="line"><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></div></div><ul><li>其语法规则,如下所示:</li></ul><p><img src="/c/assets/6.C5XiXNVN.png" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p><code>&amp;age</code><code>&amp;num</code> 中的 <code>&amp;</code>是寻址操作符,<code>&amp;age</code> 表示变量 <code>age</code> 在内存中的地址。</p></div><div class="caution custom-block github-alert"><p class="custom-block-title">CAUTION</p><p></p><ul><li><p>① scanf() 函数中的 <code>%d</code>,如果是连着写,即:<code>%d%d</code>,那么在输入数据的时候,数据之间不可以使用逗号<code>,</code>分隔只能使用空白字符空格、tab 键或回车键),即:<code>2空格3tab</code><code>2tab3回车</code>等。</p></li><li><p>② 如果是 <code>%d,%d</code>,则输入的时候需要加上逗号<code>,</code>,即:<code>2,3</code></p></li><li><p>③ 如果是 <code>%d %d</code>,则输入的时候需要加上空格,即:<code>2空格3</code></p></li></ul></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>
<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></div></div><ul><li>其语法规则,如下所示:</li></ul><p><img src="/c/assets/16.C5XiXNVN.png" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p><code>&amp;age</code><code>&amp;num</code> 中的 <code>&amp;</code>是寻址操作符,<code>&amp;age</code> 表示变量 <code>age</code> 在内存中的地址。</p></div><div class="caution custom-block github-alert"><p class="custom-block-title">CAUTION</p><p></p><ul><li><p>① scanf() 函数中的 <code>%d</code>,如果是连着写,即:<code>%d%d</code>,那么在输入数据的时候,数据之间不可以使用逗号<code>,</code>分隔只能使用空白字符空格、tab 键或回车键),即:<code>2空格3tab</code><code>2tab3回车</code>等。</p></li><li><p>② 如果是 <code>%d,%d</code>,则输入的时候需要加上逗号<code>,</code>,即:<code>2,3</code></p></li><li><p>③ 如果是 <code>%d %d</code>,则输入的时候需要加上空格,即:<code>2空格3</code></p></li></ul></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>
<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>
@ -119,7 +148,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;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> × </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> × </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> = </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, a, b, c, result);</span></span>
<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><h2 id="_1-6-标识符" tabindex="-1">1.6 标识符 <a class="header-anchor" href="#_1-6-标识符" aria-label="Permalink to &quot;1.6 标识符&quot;"></a></h2><h3 id="_1-6-1-概述" tabindex="-1">1.6.1 概述 <a class="header-anchor" href="#_1-6-1-概述" aria-label="Permalink to &quot;1.6.1 概述&quot;"></a></h3><ul><li>在 C 语言中,变量、函数、数组名、结构体等要素命名的时候使用的字符序列,称为标识符。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>在上世纪 60 - 70 年代的时候,因为国家贫穷,人民生活不富裕等原因,家长虽然会给孩子取名为:<code>张建国</code><code>李华强</code>等;但是,也会取小名为<code>二狗子</code><code>狗剩</code>等,目的是希望孩子能健康成长(养活),像 <code>张建国</code><code>李华强</code><code>二狗子</code><code>狗剩</code>都是名字(标识符),伴随人的一生。</p></div><h3 id="_1-6-2-标识符的命名规范" tabindex="-1">1.6.2 标识符的命名规范 <a class="header-anchor" href="#_1-6-2-标识符的命名规范" aria-label="Permalink to &quot;1.6.2 标识符的命名规范&quot;"></a></h3><ul><li><p>强制规范:</p><ul><li>① 只能由<code>小写</code><code>大写英文字母</code><code>0-9</code><code>_</code> 组成。</li><li>② 不能以<code>数字</code>开头。</li><li>③ 不可以是<code>关键字</code></li><li>④ 标识符具有<code>长度</code>限制,不同编译器和平台会有所不同,一般限制在 63 个字符内。</li><li>⑤ 严格<code>区分大小写字母</code>Hello、hello 是不同的标识符。</li></ul></li><li><p>建议规范:</p><ul><li>① 为了提高阅读性使用有意义的单词见名知意sumnamemaxyear 等。</li><li>② 使用下划线连接多个单词组成的标识符max_classes_per_student 等。</li><li>③ 多个单词组成的标识符,除了使用下划线连接,也可以使用小驼峰命名法,除第一个单词外,后续单词的首字母大写,如: studentId、student_name 等。</li><li>④ 不要出现仅靠大小写区分不同的标识符name、Name 容易混淆。</li><li>⑤ 系统内部使用了一些下划线开头的标识符C99 标准添加的类型 <code>_Bool</code>,为防止冲突,建议开发者尽量避免使用下划线开头的标识符。</li></ul></li><li><p>示例:合法(不一定建议)的标识符</p></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>a、BOOK_sun、MAX_SIZE、Mouse、student23、Football、FOOTBALL、max、_add、num_1、sum_of_numbers</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-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>$zj、3sum、ab#cd、23student、Foot-baii、s.com、bc、j**p、book-1、tax rate、don&#39;t</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><h3 id="_1-6-3-关键字" tabindex="-1">1.6.3 关键字 <a class="header-anchor" href="#_1-6-3-关键字" aria-label="Permalink to &quot;1.6.3 关键字&quot;"></a></h3><ul><li>C 语言中的关键字是编译器<code>预定义</code><code>保留字</code>,它们有<code>特定</code><code>含义</code><code>用途</code>,用于控制程序的结构和执行。</li><li>C80 和 C90 ANSI C定义的关键字如下所示</li></ul><table tabindex="0"><thead><tr><th>类型(功能)</th><th>具体关键字</th></tr></thead><tbody><tr><td>数据类型关键字</td><td><code>char</code><code>double</code><code>float</code><code>int</code><code>long</code><code>short</code><code>signed</code><code>unsigned</code><code>void</code></td></tr><tr><td>存储类说明符关键字</td><td><code>auto</code><code>extern</code><code>register</code><code>static</code><code>typedef</code><code>volatile</code><code>const</code></td></tr><tr><td>控制语句关键字</td><td><code>break</code><code>case</code><code>continue</code><code>default</code><code>do</code><code>else</code><code>for</code><code>goto</code><code>if</code><code>return</code><code>switch</code><code>while</code></td></tr><tr><td>结构体、联合体和枚举关键字</td><td><code>enum</code><code>struct</code><code>union</code></td></tr><tr><td>其他关键字</td><td><code>sizeof</code></td></tr></tbody></table><ul><li>C99 新增的关键字,如下所示:</li></ul><table tabindex="0"><thead><tr><th>类型(功能)</th><th>具体关键字</th></tr></thead><tbody><tr><td>数据类型关键字</td><td><code>_Bool</code><code>_Complex</code><code>_Imaginary</code></td></tr><tr><td>存储类说明符关键字</td><td><code>inline</code><code>restrict</code></td></tr><tr><td>其他关键字</td><td><code>_Complex</code><code>_Imaginary</code></td></tr></tbody></table><ul><li>C11 新增的关键字,如下所示:</li></ul><table tabindex="0"><thead><tr><th>类型(功能)</th><th>具体关键字</th></tr></thead><tbody><tr><td>存储类说明符关键字</td><td><code>_Atomic</code></td></tr><tr><td>其他关键字</td><td><code>_Alignas</code><code>_Alignof</code><code>_Generic</code><code>_Noreturn</code><code>_Static_assert</code><code>_Thread_local</code></td></tr></tbody></table><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li>① 关键字不能用作标识符(如:变量名、函数名等)。</li><li>② 不要死记硬背这些关键字,在实际开发中,并不一定全部使用到;而且,在学到后面的时候,会自动记住这些关键字以及对应的含义。</li></ul></div><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>在程序运行过程中,不能改变的量就是常量。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 在数学中的 <code>π</code>,就是一个常量,其值为 3.1415926 。</li><li>② 在生活中,人类的性别只有<code></code><code></code>;其中,<code></code><code></code>也是常量。</li><li>③ ...</li></ul></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>在 C 语言中的变量的分类,如下所示: <ul><li>① 字面量常量。</li><li>② 标识符常量: <ul><li><code>#define</code> 宏定义的标识符常量。</li><li><code>const</code> 关键字修饰的标识符常量。</li><li>枚举常量。</li></ul></li></ul></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>#define</code> 宏定义的标识符常量、<code>const</code> 关键字修饰的标识符常量、枚举常量。</li></ul></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>
<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><h2 id="_1-7-标识符" tabindex="-1">1.7 标识符 <a class="header-anchor" href="#_1-7-标识符" aria-label="Permalink to &quot;1.7 标识符&quot;"></a></h2><h3 id="_1-7-1-概述" tabindex="-1">1.7.1 概述 <a class="header-anchor" href="#_1-7-1-概述" aria-label="Permalink to &quot;1.7.1 概述&quot;"></a></h3><ul><li>在 C 语言中,变量、函数、数组名、结构体等要素命名的时候使用的字符序列,称为标识符。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>在上世纪 60 - 70 年代的时候,因为国家贫穷,人民生活不富裕等原因,家长虽然会给孩子取名为:<code>张建国</code><code>李华强</code>等;但是,也会取小名为<code>二狗子</code><code>狗剩</code>等,目的是希望孩子能健康成长(养活),像 <code>张建国</code><code>李华强</code><code>二狗子</code><code>狗剩</code>都是名字(标识符),伴随人的一生。</p></div><h3 id="_1-7-2-标识符的命名规范" tabindex="-1">1.7.2 标识符的命名规范 <a class="header-anchor" href="#_1-7-2-标识符的命名规范" aria-label="Permalink to &quot;1.7.2 标识符的命名规范&quot;"></a></h3><ul><li><p>强制规范:</p><ul><li>① 只能由<code>小写</code><code>大写英文字母</code><code>0-9</code><code>_</code> 组成。</li><li>② 不能以<code>数字</code>开头。</li><li>③ 不可以是<code>关键字</code></li><li>④ 标识符具有<code>长度</code>限制,不同编译器和平台会有所不同,一般限制在 63 个字符内。</li><li>⑤ 严格<code>区分大小写字母</code>Hello、hello 是不同的标识符。</li></ul></li><li><p>建议规范:</p><ul><li>① 为了提高阅读性使用有意义的单词见名知意sumnamemaxyear 等。</li><li>② 使用下划线连接多个单词组成的标识符max_classes_per_student 等。</li><li>③ 多个单词组成的标识符,除了使用下划线连接,也可以使用小驼峰命名法,除第一个单词外,后续单词的首字母大写,如: studentId、student_name 等。</li><li>④ 不要出现仅靠大小写区分不同的标识符name、Name 容易混淆。</li><li>⑤ 系统内部使用了一些下划线开头的标识符C99 标准添加的类型 <code>_Bool</code>,为防止冲突,建议开发者尽量避免使用下划线开头的标识符。</li></ul></li><li><p>示例:合法(不一定建议)的标识符</p></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>a、BOOK_sun、MAX_SIZE、Mouse、student23、Football、FOOTBALL、max、_add、num_1、sum_of_numbers</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-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>$zj、3sum、ab#cd、23student、Foot-baii、s.com、bc、j**p、book-1、tax rate、don&#39;t</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><h3 id="_1-7-3-关键字" tabindex="-1">1.7.3 关键字 <a class="header-anchor" href="#_1-7-3-关键字" aria-label="Permalink to &quot;1.7.3 关键字&quot;"></a></h3><ul><li>C 语言中的关键字是编译器<code>预定义</code><code>保留字</code>,它们有<code>特定</code><code>含义</code><code>用途</code>,用于控制程序的结构和执行。</li><li>C80 和 C90 ANSI C定义的关键字如下所示</li></ul><table tabindex="0"><thead><tr><th>类型(功能)</th><th>具体关键字</th></tr></thead><tbody><tr><td>数据类型关键字</td><td><code>char</code><code>double</code><code>float</code><code>int</code><code>long</code><code>short</code><code>signed</code><code>unsigned</code><code>void</code></td></tr><tr><td>存储类说明符关键字</td><td><code>auto</code><code>extern</code><code>register</code><code>static</code><code>typedef</code><code>volatile</code><code>const</code></td></tr><tr><td>控制语句关键字</td><td><code>break</code><code>case</code><code>continue</code><code>default</code><code>do</code><code>else</code><code>for</code><code>goto</code><code>if</code><code>return</code><code>switch</code><code>while</code></td></tr><tr><td>结构体、联合体和枚举关键字</td><td><code>enum</code><code>struct</code><code>union</code></td></tr><tr><td>其他关键字</td><td><code>sizeof</code></td></tr></tbody></table><ul><li>C99 新增的关键字,如下所示:</li></ul><table tabindex="0"><thead><tr><th>类型(功能)</th><th>具体关键字</th></tr></thead><tbody><tr><td>数据类型关键字</td><td><code>_Bool</code><code>_Complex</code><code>_Imaginary</code></td></tr><tr><td>存储类说明符关键字</td><td><code>inline</code><code>restrict</code></td></tr><tr><td>其他关键字</td><td><code>_Complex</code><code>_Imaginary</code></td></tr></tbody></table><ul><li>C11 新增的关键字,如下所示:</li></ul><table tabindex="0"><thead><tr><th>类型(功能)</th><th>具体关键字</th></tr></thead><tbody><tr><td>存储类说明符关键字</td><td><code>_Atomic</code></td></tr><tr><td>其他关键字</td><td><code>_Alignas</code><code>_Alignof</code><code>_Generic</code><code>_Noreturn</code><code>_Static_assert</code><code>_Thread_local</code></td></tr></tbody></table><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li>① 关键字不能用作标识符(如:变量名、函数名等)。</li><li>② 不要死记硬背这些关键字,在实际开发中,并不一定全部使用到;而且,在学到后面的时候,会自动记住这些关键字以及对应的含义。</li></ul></div><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>在程序运行过程中,不能改变的量就是常量。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 在数学中的 <code>π</code>,就是一个常量,其值为 3.1415926 。</li><li>② 在生活中,人类的性别只有<code></code><code></code>;其中,<code></code><code></code>也是常量。</li><li>③ ...</li></ul></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>在 C 语言中的变量的分类,如下所示: <ul><li>① 字面量常量。</li><li>② 标识符常量: <ul><li><code>#define</code> 宏定义的标识符常量。</li><li><code>const</code> 关键字修饰的标识符常量。</li><li>枚举常量。</li></ul></li></ul></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>#define</code> 宏定义的标识符常量、<code>const</code> 关键字修饰的标识符常量、枚举常量。</li></ul></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>
<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>
@ -197,7 +226,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;您的性别是:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, sex);</span></span>
<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><span class="line-number">16</span><br></div></div><h2 id="_2-6-defind-定义常量-vs-const-定义常量" tabindex="-1">2.6 #defind 定义常量 VS const 定义常量 <a class="header-anchor" href="#_2-6-defind-定义常量-vs-const-定义常量" aria-label="Permalink to &quot;2.6 #defind 定义常量 VS const 定义常量&quot;"></a></h2><ul><li>① 执行时机:<code>#define</code> 是预处理指令,在编译<code>之前</code>执行;<code>const</code> 是关键字,在编译<code>过程</code>中执行。</li><li>② 类型检查:<code>#define</code> 定义常量<code>不用指定类型</code><code>不进行类型检查</code>,只是简单地文本替换;<code>const</code> 定义常量<code>需要指定数据类型</code><code>会进行类型检查</code>,类型安全性更强。</li></ul><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><ul><li>计算机的底层只有<code>二进制</code>,即计算机中<code>运算</code><code>存储</code><code>所有数据</code>都需要转换为<code>二进制</code>,包括:数字、字符、图片、视频等。</li></ul><p><img src="/c/assets/7.DO8XxSV6.jpg" alt=""></p><ul><li>之前,我们也提到现代的计算机(量子计算机除外)几乎都遵循<code>冯·诺依曼</code>体系结构,其理论要点如下: <ul><li><strong>存储程序</strong><code>程序指令</code><code>数据</code>都存储在计算机的内存中,这使得程序可以在运行时修改。</li><li><strong>二进制逻辑</strong>:所有数据和指令都以<code>二进制</code>形式表示。</li><li><strong>顺序执行</strong>:指令按照它们在内存中的顺序执行,但可以有条件地改变执行顺序。</li><li><strong>五大部件</strong>:计算机由<code>运算器</code><code>控制器</code><code>存储器</code><code>输入设备</code><code>输出设备</code>组成。</li><li><strong>指令结构</strong>:指令由操作码和地址码组成,操作码指示要执行的操作,地址码指示操作数的位置。</li><li><strong>中心化控制</strong>计算机的控制单元CPU负责解释和执行指令控制数据流。</li></ul></li><li>所以,再次论证了为什么计算机只能识别二进制。</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><h3 id="_3-2-1-常见的进制" tabindex="-1">3.2.1 常见的进制 <a class="header-anchor" href="#_3-2-1-常见的进制" aria-label="Permalink to &quot;3.2.1 常见的进制&quot;"></a></h3><ul><li>在生活中,我们最为常用的进制就是<code>十进制</code>,其规则是<code>满 10 进 1</code> ,即:</li></ul><p><img src="/c/assets/8.CUXrdefp.jpeg" alt=""></p><ul><li>在计算机中,常见的进制有<code>二进制</code><code>八进制</code><code>十六进制</code>,即: <ul><li>二进制:只能 0 和 1 ,满 2 进 1 。</li><li>八进制0 ~ 7 ,满 8 进 1 。</li><li>十六进制0 ~ 9 以及 A ~ F ,满 16 进 1 。</li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>在十六进制中,除了 0 到 9 这十个数字之外,还引入了字母,以便表示超过 9 的值。字母 A 对应十进制的 10 ,字母 B 对应十进制的 11 ,以此类推,字母 F 对应十进制的 15。</p></div><ul><li>进制的换算举例,如下所示:</li></ul><table tabindex="0"><thead><tr><th>十进制</th><th>二进制</th><th>八进制</th><th>十六进制</th></tr></thead><tbody><tr><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>2</td><td>10</td><td>2</td><td>2</td></tr><tr><td>3</td><td>11</td><td>3</td><td>3</td></tr><tr><td>4</td><td>100</td><td>4</td><td>4</td></tr><tr><td>5</td><td>101</td><td>5</td><td>5</td></tr><tr><td>6</td><td>110</td><td>6</td><td>6</td></tr><tr><td>7</td><td>111</td><td>7</td><td>7</td></tr><tr><td>8</td><td>1000</td><td>10</td><td>8</td></tr><tr><td>9</td><td>1001</td><td>11</td><td>9</td></tr><tr><td>10</td><td>1010</td><td>12</td><td>a 或 A</td></tr><tr><td>11</td><td>1011</td><td>13</td><td>b 或 B</td></tr><tr><td>12</td><td>1100</td><td>14</td><td>c 或 C</td></tr><tr><td>13</td><td>1101</td><td>15</td><td>d 或 D</td></tr><tr><td>14</td><td>1110</td><td>16</td><td>e 或 E</td></tr><tr><td>15</td><td>1111</td><td>17</td><td>f 或 F</td></tr><tr><td>16</td><td>10000</td><td>20</td><td>10</td></tr><tr><td>...</td><td>...</td><td>...</td><td>...</td></tr></tbody></table><ul><li>二进制和十六进制的关系:十六进制是以 16 为基数的进制系统16 在二进制中表示为 ( 2^4 ),即:一个十六进制可以表示 4 位二进制。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>十六进制的范围是0 ~ F 0 ~ 15对应的二进制数的范围是0000 ~ 1111 0 ~ 15</p></div><ul><li>每个十六进制数都可以映射到一个唯一的 4 位二进制数,即:</li></ul><table tabindex="0"><thead><tr><th>十六进制</th><th>二进制</th></tr></thead><tbody><tr><td>0</td><td>0000</td></tr><tr><td>1</td><td>0001</td></tr><tr><td>2</td><td>0010</td></tr><tr><td>3</td><td>0011</td></tr><tr><td>4</td><td>0100</td></tr><tr><td>5</td><td>0101</td></tr><tr><td>6</td><td>0110</td></tr><tr><td>7</td><td>0111</td></tr><tr><td>8</td><td>1000</td></tr><tr><td>9</td><td>1001</td></tr><tr><td>A</td><td>1010</td></tr><tr><td>B</td><td>1011</td></tr><tr><td>C</td><td>1100</td></tr><tr><td>D</td><td>1101</td></tr><tr><td>E</td><td>1110</td></tr><tr><td>F</td><td>1111</td></tr></tbody></table><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>由此可见,每个十六进制数字确实由 4 位二进制数表示。</p></div><ul><li>二进制和八进制的关系:八进制是以 8 为基数的进制系统8 在二进制中表示为 ( 2^3 );即:一个八进制位可以表示 3 个二进制位。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>八进制的范围是0 ~ 7 对应的二进制数的范围是000 ~ 111。</p></div><ul><li>每个八进制数位都可以映射到一个唯一的 3 位二进制数,即:</li></ul><table tabindex="0"><thead><tr><th>八进制</th><th>二进制</th></tr></thead><tbody><tr><td>0</td><td>000</td></tr><tr><td>1</td><td>001</td></tr><tr><td>2</td><td>010</td></tr><tr><td>3</td><td>011</td></tr><tr><td>4</td><td>100</td></tr><tr><td>5</td><td>101</td></tr><tr><td>6</td><td>110</td></tr><tr><td>7</td><td>111</td></tr></tbody></table><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>由此可见,每个八进制数字确实由 3 位二进制数表示。</p></div><h3 id="_3-2-2-c-语言中如何表示不同进制的整数" tabindex="-1">3.2.2 C 语言中如何表示不同进制的整数? <a class="header-anchor" href="#_3-2-2-c-语言中如何表示不同进制的整数" aria-label="Permalink to &quot;3.2.2 C 语言中如何表示不同进制的整数?&quot;"></a></h3><ul><li><p>规则如下:</p><ul><li>在 C 语言中,如果是<code>二进制</code>(字面常量),则需要在二进制整数前加上 <code>0b</code><code>0B</code></li><li>在 C 语言中,如果是<code>八进制</code>(字面常量),则需要在八进制整数前加上 <code>0</code></li><li>在 C 语言中,如果是<code>十进制</code>(字面常量),正常数字表示即可。</li><li>在 C 语言中,如果是<code>十六进制</code>(字面常量),则需要在十六进制整数前加上 <code>0x</code><code>0X</code></li></ul></li><li><p>示例:</p></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><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></div></div><h2 id="_2-6-defind-定义常量-vs-const-定义常量" tabindex="-1">2.6 #defind 定义常量 VS const 定义常量 <a class="header-anchor" href="#_2-6-defind-定义常量-vs-const-定义常量" aria-label="Permalink to &quot;2.6 #defind 定义常量 VS const 定义常量&quot;"></a></h2><ul><li>① 执行时机:<code>#define</code> 是预处理指令,在编译<code>之前</code>执行;<code>const</code> 是关键字,在编译<code>过程</code>中执行。</li><li>② 类型检查:<code>#define</code> 定义常量<code>不用指定类型</code><code>不进行类型检查</code>,只是简单地文本替换;<code>const</code> 定义常量<code>需要指定数据类型</code><code>会进行类型检查</code>,类型安全性更强。</li></ul><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><ul><li>计算机的底层只有<code>二进制</code>,即计算机中<code>运算</code><code>存储</code><code>所有数据</code>都需要转换为<code>二进制</code>,包括:数字、字符、图片、视频等。</li></ul><p><img src="/c/assets/17.DO8XxSV6.jpg" alt=""></p><ul><li>之前,我们也提到现代的计算机(量子计算机除外)几乎都遵循<code>冯·诺依曼</code>体系结构,其理论要点如下: <ul><li><strong>存储程序</strong><code>程序指令</code><code>数据</code>都存储在计算机的内存中,这使得程序可以在运行时修改。</li><li><strong>二进制逻辑</strong>:所有数据和指令都以<code>二进制</code>形式表示。</li><li><strong>顺序执行</strong>:指令按照它们在内存中的顺序执行,但可以有条件地改变执行顺序。</li><li><strong>五大部件</strong>:计算机由<code>运算器</code><code>控制器</code><code>存储器</code><code>输入设备</code><code>输出设备</code>组成。</li><li><strong>指令结构</strong>:指令由操作码和地址码组成,操作码指示要执行的操作,地址码指示操作数的位置。</li><li><strong>中心化控制</strong>计算机的控制单元CPU负责解释和执行指令控制数据流。</li></ul></li><li>所以,再次论证了为什么计算机只能识别二进制。</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><h3 id="_3-2-1-常见的进制" tabindex="-1">3.2.1 常见的进制 <a class="header-anchor" href="#_3-2-1-常见的进制" aria-label="Permalink to &quot;3.2.1 常见的进制&quot;"></a></h3><ul><li>在生活中,我们最为常用的进制就是<code>十进制</code>,其规则是<code>满 10 进 1</code> ,即:</li></ul><p><img src="/c/assets/18.CUXrdefp.jpeg" alt=""></p><ul><li>在计算机中,常见的进制有<code>二进制</code><code>八进制</code><code>十六进制</code>,即: <ul><li>二进制:只能 0 和 1 ,满 2 进 1 。</li><li>八进制0 ~ 7 ,满 8 进 1 。</li><li>十六进制0 ~ 9 以及 A ~ F ,满 16 进 1 。</li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>在十六进制中,除了 0 到 9 这十个数字之外,还引入了字母,以便表示超过 9 的值。字母 A 对应十进制的 10 ,字母 B 对应十进制的 11 ,以此类推,字母 F 对应十进制的 15。</p></div><ul><li>进制的换算举例,如下所示:</li></ul><table tabindex="0"><thead><tr><th>十进制</th><th>二进制</th><th>八进制</th><th>十六进制</th></tr></thead><tbody><tr><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>2</td><td>10</td><td>2</td><td>2</td></tr><tr><td>3</td><td>11</td><td>3</td><td>3</td></tr><tr><td>4</td><td>100</td><td>4</td><td>4</td></tr><tr><td>5</td><td>101</td><td>5</td><td>5</td></tr><tr><td>6</td><td>110</td><td>6</td><td>6</td></tr><tr><td>7</td><td>111</td><td>7</td><td>7</td></tr><tr><td>8</td><td>1000</td><td>10</td><td>8</td></tr><tr><td>9</td><td>1001</td><td>11</td><td>9</td></tr><tr><td>10</td><td>1010</td><td>12</td><td>a 或 A</td></tr><tr><td>11</td><td>1011</td><td>13</td><td>b 或 B</td></tr><tr><td>12</td><td>1100</td><td>14</td><td>c 或 C</td></tr><tr><td>13</td><td>1101</td><td>15</td><td>d 或 D</td></tr><tr><td>14</td><td>1110</td><td>16</td><td>e 或 E</td></tr><tr><td>15</td><td>1111</td><td>17</td><td>f 或 F</td></tr><tr><td>16</td><td>10000</td><td>20</td><td>10</td></tr><tr><td>...</td><td>...</td><td>...</td><td>...</td></tr></tbody></table><ul><li>二进制和十六进制的关系:十六进制是以 16 为基数的进制系统16 在二进制中表示为 ( 2^4 ),即:一个十六进制可以表示 4 位二进制。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>十六进制的范围是0 ~ F 0 ~ 15对应的二进制数的范围是0000 ~ 1111 0 ~ 15</p></div><ul><li>每个十六进制数都可以映射到一个唯一的 4 位二进制数,即:</li></ul><table tabindex="0"><thead><tr><th>十六进制</th><th>二进制</th></tr></thead><tbody><tr><td>0</td><td>0000</td></tr><tr><td>1</td><td>0001</td></tr><tr><td>2</td><td>0010</td></tr><tr><td>3</td><td>0011</td></tr><tr><td>4</td><td>0100</td></tr><tr><td>5</td><td>0101</td></tr><tr><td>6</td><td>0110</td></tr><tr><td>7</td><td>0111</td></tr><tr><td>8</td><td>1000</td></tr><tr><td>9</td><td>1001</td></tr><tr><td>A</td><td>1010</td></tr><tr><td>B</td><td>1011</td></tr><tr><td>C</td><td>1100</td></tr><tr><td>D</td><td>1101</td></tr><tr><td>E</td><td>1110</td></tr><tr><td>F</td><td>1111</td></tr></tbody></table><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>由此可见,每个十六进制数字确实由 4 位二进制数表示。</p></div><ul><li>二进制和八进制的关系:八进制是以 8 为基数的进制系统8 在二进制中表示为 ( 2^3 );即:一个八进制位可以表示 3 个二进制位。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>八进制的范围是0 ~ 7 对应的二进制数的范围是000 ~ 111。</p></div><ul><li>每个八进制数位都可以映射到一个唯一的 3 位二进制数,即:</li></ul><table tabindex="0"><thead><tr><th>八进制</th><th>二进制</th></tr></thead><tbody><tr><td>0</td><td>000</td></tr><tr><td>1</td><td>001</td></tr><tr><td>2</td><td>010</td></tr><tr><td>3</td><td>011</td></tr><tr><td>4</td><td>100</td></tr><tr><td>5</td><td>101</td></tr><tr><td>6</td><td>110</td></tr><tr><td>7</td><td>111</td></tr></tbody></table><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>由此可见,每个八进制数字确实由 3 位二进制数表示。</p></div><h3 id="_3-2-2-c-语言中如何表示不同进制的整数" tabindex="-1">3.2.2 C 语言中如何表示不同进制的整数? <a class="header-anchor" href="#_3-2-2-c-语言中如何表示不同进制的整数" aria-label="Permalink to &quot;3.2.2 C 语言中如何表示不同进制的整数?&quot;"></a></h3><ul><li><p>规则如下:</p><ul><li>在 C 语言中,如果是<code>二进制</code>(字面常量),则需要在二进制整数前加上 <code>0b</code><code>0B</code></li><li>在 C 语言中,如果是<code>八进制</code>(字面常量),则需要在八进制整数前加上 <code>0</code></li><li>在 C 语言中,如果是<code>十进制</code>(字面常量),正常数字表示即可。</li><li>在 C 语言中,如果是<code>十六进制</code>(字面常量),则需要在十六进制整数前加上 <code>0x</code><code>0X</code></li></ul></li><li><p>示例:</p></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>
@ -226,8 +255,8 @@
<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;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 的十六进制(前缀)整数: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%#X\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, num, num);</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 100 的十六进制(前缀)整数: 0X64</span></span>
<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><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></ul><p><img src="/c/assets/9.uqLiL_yu.png" alt=""></p><ul><li>在计算机中,数据是从右往左的方式排列的;其中,最右边的是低位,最左边的是高位,即:</li></ul><p><img src="/c/assets/10.CkykpHY2.png" alt=""></p><h3 id="_3-3-2-二进制和十进制的转换" tabindex="-1">3.3.2 二进制和十进制的转换 <a class="header-anchor" href="#_3-3-2-二进制和十进制的转换" aria-label="Permalink to &quot;3.3.2 二进制和十进制的转换&quot;"></a></h3><h4 id="_3-3-2-1-二进制转换为十进制" tabindex="-1">3.3.2.1 二进制转换为十进制 <a class="header-anchor" href="#_3-3-2-1-二进制转换为十进制" aria-label="Permalink to &quot;3.3.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/11.DV1YbrOP.png" alt=""></p><ul><li>示例:二进制转十进制</li></ul><p><img src="/c/assets/12.AHNJT9TV.png" alt=""></p><h4 id="_3-3-2-2-十进制转换二进制" tabindex="-1">3.3.2.2 十进制转换二进制 <a class="header-anchor" href="#_3-3-2-2-十进制转换二进制" aria-label="Permalink to &quot;3.3.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/13.Bs-MOwx2.png" alt=""></p><ul><li>示例:十进制转二进制</li></ul><p><img src="/c/assets/14.StzjmBz-.png" alt=""></p><h3 id="_3-3-3-二进制转八进制" tabindex="-1">3.3.3 二进制转八进制 <a class="header-anchor" href="#_3-3-3-二进制转八进制" aria-label="Permalink to &quot;3.3.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/15.C0wVWaxD.png" alt=""></p><h3 id="_3-3-4-二进制转十六进制" tabindex="-1">3.3.4 二进制转十六进制 <a class="header-anchor" href="#_3-3-4-二进制转十六进制" aria-label="Permalink to &quot;3.3.4 二进制转十六进制&quot;"></a></h3><ul><li><p>规则:每 4 位二进制就是一个八进制。</p></li><li><p>示例1110 1001 -&gt; 0xE9</p></li></ul><p><img src="/c/assets/16.LXJMAihe.png" alt=""></p><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>机器数一个数在计算机的存储形式是二进制我们称这些二进制数为机器数。机器数可以是有符号的用机器数的最高位来存放符号位0 表示正数1 表示负数。</li></ul><p><img src="/c/assets/17._UTCq3PD.png" alt=""></p><ul><li>真值:因为机器数带有符号位,所以机器数的形式值不等于其真实表示的值(真值),以机器数 1000 0001 为例,其真正表示的值(首位是符号位)为 -1而形式值却是 129 ,因此将带有符号位的机器数的真正表示的值称为机器数的真值。</li></ul><p><img src="/c/assets/18.BjQ5kBL-.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><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-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>规则:</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-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>规则:</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/19.COIOzcmT.png" alt=""></p><ul><li>如果 0 ,按照 <code>-0</code> 的情况进行处理,即:</li></ul><p><img src="/c/assets/20.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-4-5-总结" tabindex="-1">3.4.5 总结 <a class="header-anchor" href="#_3-4-5-总结" aria-label="Permalink to &quot;3.4.5 总结&quot;"></a></h3><ul><li>① 正数的原码、反码和补码都是一样的,三码合一。</li><li>② 负数的反码是在其原码的基础上按位取反0 变 1 1 变 0 ),符号位不变;负数的补码是其反码 + 1 。</li><li>③ 0 的补码是 0 。</li></ul><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><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/21.BX_KzkHt.png" alt=""></p><ul><li><code>补码</code>的设计可以巧妙的让<code>符号位</code>也参与计算,并且可以得到<code>正确的计算结果</code>,即:</li></ul><p><img src="/c/assets/22.COt_QxSP.png" alt=""></p></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-d4a0bba5><!--[--><!--]--><div class="edit-info" data-v-d4a0bba5><!----><div class="last-updated" data-v-d4a0bba5><p class="VPLastUpdated" data-v-d4a0bba5 data-v-7e05ebdb>上次更新: <time datetime="2024-07-11T08:05:05.000Z" data-v-7e05ebdb></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-d4a0bba5><span class="visually-hidden" id="doc-footer-aria-label" data-v-d4a0bba5>Pager</span><div class="pager" data-v-d4a0bba5><a class="VPLink link pager-link prev" href="/c/notes/01_c-basic/01_xdx/" data-v-d4a0bba5><!--[--><span class="desc" data-v-d4a0bba5>上一篇</span><span class="title" data-v-d4a0bba5>C 语言入门</span><!--]--></a></div><div class="pager" data-v-d4a0bba5><a class="VPLink link pager-link next" href="/c/notes/02_dsa/01_xdx/" data-v-d4a0bba5><!--[--><span class="desc" data-v-d4a0bba5>下一篇</span><span class="title" data-v-d4a0bba5>初识 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("{\"notes_index.md\":\"CdHKXnBk\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cux_q1Jy\",\"index.md\":\"uFk6fSzW\"}");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\":\"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\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"初识 C 语言\",\"link\":\"/notes/02_dsa/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]}]},\"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:#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><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></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-3-2-二进制和十进制的转换" tabindex="-1">3.3.2 二进制和十进制的转换 <a class="header-anchor" href="#_3-3-2-二进制和十进制的转换" aria-label="Permalink to &quot;3.3.2 二进制和十进制的转换&quot;"></a></h3><h4 id="_3-3-2-1-二进制转换为十进制" tabindex="-1">3.3.2.1 二进制转换为十进制 <a class="header-anchor" href="#_3-3-2-1-二进制转换为十进制" aria-label="Permalink to &quot;3.3.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-3-2-2-十进制转换二进制" tabindex="-1">3.3.2.2 十进制转换二进制 <a class="header-anchor" href="#_3-3-2-2-十进制转换二进制" aria-label="Permalink to &quot;3.3.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-3-3-二进制转八进制" tabindex="-1">3.3.3 二进制转八进制 <a class="header-anchor" href="#_3-3-3-二进制转八进制" aria-label="Permalink to &quot;3.3.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-3-4-二进制转十六进制" tabindex="-1">3.3.4 二进制转十六进制 <a class="header-anchor" href="#_3-3-4-二进制转十六进制" aria-label="Permalink to &quot;3.3.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-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>机器数一个数在计算机的存储形式是二进制我们称这些二进制数为机器数。机器数可以是有符号的用机器数的最高位来存放符号位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-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><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-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>规则:</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-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>规则:</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>转换`为加法运算,可以简化硬件设计,提高了运算效率。</li><li>③ 计算机底层<code>存储</code><code>计算</code>的都是<code>二进数的补码</code></li></ul></div><h3 id="_3-4-5-总结" tabindex="-1">3.4.5 总结 <a class="header-anchor" href="#_3-4-5-总结" aria-label="Permalink to &quot;3.4.5 总结&quot;"></a></h3><ul><li>① 正数的原码、反码和补码都是一样的,三码合一。</li><li>② 负数的反码是在其原码的基础上按位取反0 变 1 1 变 0 ),符号位不变;负数的补码是其反码 + 1 。</li><li>③ 0 的补码是 0 。</li></ul><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><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-d4a0bba5><!--[--><!--]--><div class="edit-info" data-v-d4a0bba5><!----><div class="last-updated" data-v-d4a0bba5><p class="VPLastUpdated" data-v-d4a0bba5 data-v-7e05ebdb>上次更新: <time datetime="2024-07-15T07:26:13.000Z" data-v-7e05ebdb></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-d4a0bba5><span class="visually-hidden" id="doc-footer-aria-label" data-v-d4a0bba5>Pager</span><div class="pager" data-v-d4a0bba5><a class="VPLink link pager-link prev" href="/c/notes/01_c-basic/01_xdx/" data-v-d4a0bba5><!--[--><span class="desc" data-v-d4a0bba5>上一篇</span><span class="title" data-v-d4a0bba5>C 语言入门</span><!--]--></a></div><div class="pager" data-v-d4a0bba5><a class="VPLink link pager-link next" href="/c/notes/02_dsa/01_xdx/" data-v-d4a0bba5><!--[--><span class="desc" data-v-d4a0bba5>下一篇</span><span class="title" data-v-d4a0bba5>初识 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\":\"uFk6fSzW\",\"notes_index.md\":\"CdHKXnBk\",\"notes_01_c-basic_02_xdx_index.md\":\"CB8oZG6k\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\"}");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\":\"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\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"初识 C 语言\",\"link\":\"/notes/02_dsa/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]}]},\"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,10 +8,10 @@
<meta name="generator" content="VitePress v1.2.3">
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
<script type="module" src="/c/assets/app.NavY-WoM.js"></script>
<script type="module" src="/c/assets/app.DJvpVQC4.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/framework.BE8if9e6.js">
<link rel="modulepreload" href="/c/assets/chunks/theme.Dwe0RGAL.js">
<link rel="modulepreload" href="/c/assets/chunks/theme.C4MahGFn.js">
<link rel="modulepreload" href="/c/assets/notes_index.md.CdHKXnBk.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">
@ -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-ccf7ddec><div class="wrapper" data-v-ccf7ddec><div class="container" data-v-ccf7ddec><div class="title" data-v-ccf7ddec><div class="VPNavBarTitle has-sidebar" data-v-ccf7ddec 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-ccf7ddec><div class="content-body" data-v-ccf7ddec><!--[--><!--]--><div class="VPNavBarSearch search" data-v-ccf7ddec><!--[--><!----><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-ccf7ddec data-v-7f418b0f><span id="main-nav-aria-label" class="visually-hidden" data-v-7f418b0f>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-7f418b0f 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-7f418b0f data-v-9c663999><!--[--><span data-v-9c663999>计组6件套</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink active" href="/c/notes/" tabindex="0" data-v-7f418b0f data-v-9c663999><!--[--><span data-v-9c663999>c/c++</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/web-design/notes/" target="_blank" rel="noreferrer" tabindex="0" data-v-7f418b0f data-v-9c663999><!--[--><span data-v-9c663999>前端</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/java/notes/" target="_blank" rel="noreferrer" tabindex="0" data-v-7f418b0f data-v-9c663999><!--[--><span data-v-9c663999>Java</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/big-data/notes/" target="_blank" rel="noreferrer" tabindex="0" data-v-7f418b0f data-v-9c663999><!--[--><span data-v-9c663999>大数据</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://aexiar.github.io/linux/notes/" target="_blank" rel="noreferrer" tabindex="0" data-v-7f418b0f data-v-9c663999><!--[--><span data-v-9c663999>云原生</span><!--]--></a><!--]--><!--[--><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-7f418b0f data-v-9c663999><!--[--><span data-v-9c663999>开源软件</span><!--]--></a><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-ccf7ddec data-v-e6aabb21><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-e6aabb21 data-v-d1f28634 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-d1f28634></span><span class="vpi-moon moon" data-v-d1f28634></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-ccf7ddec 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-ccf7ddec data-v-d0bd9dde 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-e7ea1737><!----><!--[--><!--[--><!----><div class="group" data-v-d0bd9dde><div class="item appearance" data-v-d0bd9dde><p class="label" data-v-d0bd9dde>Appearance</p><div class="appearance-action" data-v-d0bd9dde><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-d0bd9dde data-v-d1f28634 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-d1f28634></span><span class="vpi-moon moon" data-v-d1f28634></span><!--]--></span></span></button></div></div></div><div class="group" data-v-d0bd9dde><div class="item social-links" data-v-d0bd9dde><div class="VPSocialLinks social-links-list" data-v-d0bd9dde 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-ccf7ddec 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-ccf7ddec><div class="divider-line" data-v-ccf7ddec></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-575e6a36><div class="curtain" data-v-575e6a36></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-575e6a36><span class="visually-hidden" id="sidebar-aria-label" data-v-575e6a36> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="group" data-v-575e6a36><section class="VPSidebarItem level-0 collapsible collapsed" data-v-575e6a36 data-v-b8d55f3b><div class="item" role="button" tabindex="0" data-v-b8d55f3b><div class="indicator" data-v-b8d55f3b></div><h2 class="text" data-v-b8d55f3b>C 语言基础</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b8d55f3b><span class="vpi-chevron-right caret-icon" data-v-b8d55f3b></span></div></div><div class="items" data-v-b8d55f3b><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b8d55f3b data-v-b8d55f3b><div class="item" data-v-b8d55f3b><div class="indicator" data-v-b8d55f3b></div><a class="VPLink link link" href="/c/notes/01_c-basic/01_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>C 语言入门</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b8d55f3b data-v-b8d55f3b><div class="item" data-v-b8d55f3b><div class="indicator" data-v-b8d55f3b></div><a class="VPLink link link" href="/c/notes/01_c-basic/02_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>变量和进制</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="group" data-v-575e6a36><section class="VPSidebarItem level-0 collapsible collapsed" data-v-575e6a36 data-v-b8d55f3b><div class="item" role="button" tabindex="0" data-v-b8d55f3b><div class="indicator" data-v-b8d55f3b></div><h2 class="text" data-v-b8d55f3b>C 语言高级</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b8d55f3b><span class="vpi-chevron-right caret-icon" data-v-b8d55f3b></span></div></div><div class="items" data-v-b8d55f3b><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b8d55f3b data-v-b8d55f3b><div class="item" data-v-b8d55f3b><div class="indicator" data-v-b8d55f3b></div><a class="VPLink link link" href="/c/notes/02_dsa/01_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>初识 C 语言</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="group" data-v-575e6a36><section class="VPSidebarItem level-0 collapsible collapsed" data-v-575e6a36 data-v-b8d55f3b><div class="item" role="button" tabindex="0" data-v-b8d55f3b><div class="indicator" data-v-b8d55f3b></div><h2 class="text" data-v-b8d55f3b>C++ 核心编程</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b8d55f3b><span class="vpi-chevron-right caret-icon" data-v-b8d55f3b></span></div></div><div class="items" data-v-b8d55f3b><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b8d55f3b data-v-b8d55f3b><div class="item" data-v-b8d55f3b><div class="indicator" data-v-b8d55f3b></div><a class="VPLink link link" href="/c/notes/03_coa/03_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>计算机组成原理前言</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="group" data-v-575e6a36><section class="VPSidebarItem level-0 collapsible collapsed" data-v-575e6a36 data-v-b8d55f3b><div class="item" role="button" tabindex="0" data-v-b8d55f3b><div class="indicator" data-v-b8d55f3b></div><h2 class="text" data-v-b8d55f3b>C++ 标准库</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b8d55f3b><span class="vpi-chevron-right caret-icon" data-v-b8d55f3b></span></div></div><div class="items" data-v-b8d55f3b><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b8d55f3b data-v-b8d55f3b><div class="item" data-v-b8d55f3b><div class="indicator" data-v-b8d55f3b></div><a class="VPLink link link" href="/c/notes/03_coa/03_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>计算机组成原理前言</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="group" data-v-575e6a36><section class="VPSidebarItem level-0 collapsible collapsed" data-v-575e6a36 data-v-b8d55f3b><div class="item" role="button" tabindex="0" data-v-b8d55f3b><div class="indicator" data-v-b8d55f3b></div><h2 class="text" data-v-b8d55f3b>QT 桌面开发</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b8d55f3b><span class="vpi-chevron-right caret-icon" data-v-b8d55f3b></span></div></div><div class="items" data-v-b8d55f3b><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b8d55f3b data-v-b8d55f3b><div class="item" data-v-b8d55f3b><div class="indicator" data-v-b8d55f3b></div><a class="VPLink link link" href="/c/notes/04_os/01_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>操作系统前言</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="group" data-v-575e6a36><section class="VPSidebarItem level-0 collapsible collapsed" data-v-575e6a36 data-v-b8d55f3b><div class="item" role="button" tabindex="0" data-v-b8d55f3b><div class="indicator" data-v-b8d55f3b></div><h2 class="text" data-v-b8d55f3b>Linux 高并发服务器开发</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b8d55f3b><span class="vpi-chevron-right caret-icon" data-v-b8d55f3b></span></div></div><div class="items" data-v-b8d55f3b><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b8d55f3b data-v-b8d55f3b><div class="item" data-v-b8d55f3b><div class="indicator" data-v-b8d55f3b></div><a class="VPLink link link" href="/c/notes/04_os/01_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>操作系统前言</p><!--]--></a><!----></div><!----></div><!--]--></div></section></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="计算机基础知识" tabindex="-1">计算机基础知识 <a class="header-anchor" href="#计算机基础知识" aria-label="Permalink to &quot;计算机基础知识&quot;"></a></h1><hr><iframe src="https://roadmap.sh/r/embed?id=668c68522c7edd3e44893630" width="115%" height="500px" frameBorder="0"></iframe></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-d4a0bba5><!--[--><!--]--><div class="edit-info" data-v-d4a0bba5><!----><div class="last-updated" data-v-d4a0bba5><p class="VPLastUpdated" data-v-d4a0bba5 data-v-7e05ebdb>上次更新: <time datetime="2024-07-11T08:05:05.000Z" data-v-7e05ebdb></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-d4a0bba5><span class="visually-hidden" id="doc-footer-aria-label" data-v-d4a0bba5>Pager</span><div class="pager" data-v-d4a0bba5><!----></div><div class="pager" data-v-d4a0bba5><a class="VPLink link pager-link next" href="/c/notes/01_c-basic/01_xdx/" data-v-d4a0bba5><!--[--><span class="desc" data-v-d4a0bba5>下一篇</span><span class="title" data-v-d4a0bba5>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("{\"notes_index.md\":\"CdHKXnBk\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cux_q1Jy\",\"index.md\":\"uFk6fSzW\"}");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\":\"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\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"初识 C 语言\",\"link\":\"/notes/02_dsa/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]}]},\"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\":\"uFk6fSzW\",\"notes_index.md\":\"CdHKXnBk\",\"notes_01_c-basic_02_xdx_index.md\":\"CB8oZG6k\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\"}");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\":\"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\":\"开源软件\",\"link\":\"https://aexiar.github.io/open-software/notes/\"}],\"sidebar\":{\"/notes/\":[{\"text\":\"C 语言基础\",\"collapsed\":true,\"items\":[{\"text\":\"C 语言入门\",\"link\":\"/notes/01_c-basic/01_xdx/\"},{\"text\":\"变量和进制\",\"link\":\"/notes/01_c-basic/02_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[{\"text\":\"初识 C 语言\",\"link\":\"/notes/02_dsa/01_xdx/\"}]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[{\"text\":\"计算机组成原理前言\",\"link\":\"/notes/03_coa/03_xdx/\"}]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[{\"text\":\"操作系统前言\",\"link\":\"/notes/04_os/01_xdx/\"}]}]},\"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>