mirror of
https://github.com/Aexiar/c.git
synced 2024-10-22 14:05:45 +02:00
deploy: 7a7b573857273ad1f55b345d4658415a9f1cd4a6
This commit is contained in:
parent
b7599a7e81
commit
f0ae51538e
4
404.html
4
404.html
@ -8,7 +8,7 @@
|
|||||||
<meta name="generator" content="VitePress v1.2.3">
|
<meta name="generator" content="VitePress v1.2.3">
|
||||||
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
|
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
|
||||||
|
|
||||||
<script type="module" src="/c/assets/app.DrgBDoBl.js"></script>
|
<script type="module" src="/c/assets/app.DN8pJb91.js"></script>
|
||||||
<link rel="preload" href="/c/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
|
<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">
|
<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="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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"uFk6fSzW\",\"notes_index.md\":\"3bIiHjBr\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cxyt4HEd\",\"notes_01_c-basic_04_xdx_index.md\":\"CJSxDj__\",\"notes_01_c-basic_03_xdx_index.md\":\"CgLUd3rz\"}");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\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"uFk6fSzW\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cxyt4HEd\",\"notes_index.md\":\"3bIiHjBr\",\"notes_01_c-basic_04_xdx_index.md\":\"CJSxDj__\",\"notes_01_c-basic_03_xdx_index.md\":\"No5lEq6U\"}");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\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -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.DeJoNarU.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.CbwtpqME.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};
|
1
assets/chunks/@localSearchIndexroot.BCe7Vyjj.js
Normal file
1
assets/chunks/@localSearchIndexroot.BCe7Vyjj.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -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.DeJoNarU.js";const nr={root:()=>Dt(()=>import("./@localSearchIndexroot.DdPrnzto.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.CbwtpqME.js";const nr={root:()=>Dt(()=>import("./@localSearchIndexroot.BCe7Vyjj.js"),[])};/*!
|
||||||
* tabbable 6.2.0
|
* tabbable 6.2.0
|
||||||
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
* @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)};/*!
|
*/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
@ -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.L8V3GBrc.png",p="/c/assets/2.BkF1yWLn.png",t="/c/assets/3.CceY8r_n.png",h="/c/assets/4.DHaUgOwj.png",k="/c/assets/5.CXGaq_zh.png",e="/c/assets/6.BrZYAEEl.png",r="/c/assets/7.DpCroFHv.png",d="/c/assets/8.Cr7P0Gji.png",E="/c/assets/9.NlBmD7pA.png",c="/c/assets/10.ZiBq6Pno.png",g="/c/assets/11.DAgmsf-w.png",F="/c/assets/12.B2iC37fw.png",y="/c/assets/14.BlE3ZFud.png",u="/c/assets/15.CdvhiwcU.png",b="/c/assets/16.D74t3-Xt.png",o="/c/assets/17.DdAZIfeP.png",C="/c/assets/18.B4Zfj2jX.png",m="/c/assets/19.IfpA0D5n.png",B="/c/assets/20.CfIzYazX.png",A="/c/assets/21.eHnZcbpI.png",D="/c/assets/22.BNoKlM4o.png",v="/c/assets/23.CMVtwrqr.png",q="/c/assets/24.CN19KJG7.png",f="/c/assets/25.BIhiJHjz.png",_="/c/assets/26.A_E4n4g8.png",x="/c/assets/27.Bv4qFbwF.png",z="/c/assets/28.IKaazo2J.png",w="/c/assets/29.CGTVELeO.png",I="/c/assets/30.Bz4_lEH0.gif",P="/c/assets/31.CcDWE4nn.png",T="/c/assets/32.B7y2_JVX.gif",N="/c/assets/33.Btcc3rs2.gif",L="/c/assets/34.CR4ARW8y.png",O="/c/assets/33.Btcc3rs2.gif",S="/c/assets/36.DOX3ymYP.gif",U="/c/assets/37.Cie9_tkP.gif",M="/c/assets/38.DLjH9Ges.png",$=JSON.parse('{"title":"第一章:数据类型(⭐)","description":"","frontmatter":{},"headers":[],"relativePath":"notes/01_c-basic/03_xdx/index.md","filePath":"notes/01_c-basic/03_xdx/index.md","lastUpdated":1721377218000}'),X={name:"notes/01_c-basic/03_xdx/index.md"},R=n('<h1 id="第一章-数据类型-⭐" tabindex="-1">第一章:数据类型(⭐) <a class="header-anchor" href="#第一章-数据类型-⭐" aria-label="Permalink to "第一章:数据类型(⭐)""></a></h1><h2 id="_1-1-概述" tabindex="-1">1.1 概述 <a class="header-anchor" href="#_1-1-概述" aria-label="Permalink to "1.1 概述""></a></h2><ul><li><p>根据<code>变量</code>中<code>存储</code>的<code>值</code>的<code>不同</code>,我们可以将<code>变量</code>分为两类:</p><ul><li><code>普通变量</code>:变量所对应的内存中存储的是<code>普通值</code>。</li><li><code>指针变量</code>:变量所对应的内存中存储的是<code>另一个变量的地址</code>。</li></ul></li><li><p>如下图所示:</p></li></ul><p><img src="'+l+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>普通变量和指针变量的相同点:</p><ul><li>普通变量有内存空间,指针变量也有内存空间。</li><li>普通变量有内存地址,指针变量也有内存地址。</li><li>普通变量所对应的内存空间中有值,指针变量所对应的内存空间中也有值。</li></ul><p>普通变量和指针变量的不同点:</p><ul><li>普通变量所对应的内存空间存储的是普通的值,如:整数、小数、字符等;指针变量所对应的内存空间存储的是另外一个变量的地址。</li><li>普通变量有普通变量的运算方式,而指针变量有指针变量的运算方式(后续讲解)。</li></ul></div><ul><li>那么,在 C 语言中变量的数据类型就可以这么划分,如下所示:</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>根据<code>普通变量</code>中<code>存储</code>的<code>值</code>的类型不同,可以将<code>普通变量类型</code>划分为<code>基本数据类型</code>(整型、字符类型、浮点类型、布尔类型)和<code>复合数据类型</code>(数组类型、结构体类型、共用体类型、枚举类型)。</li><li>根据<code>指针变量</code>所<code>指向空间</code>中<code>存储</code>的<code>值</code>的类型不同,可以将<code>指针类型</code>分为<code>基本数据类型指针</code>、<code>复合数据类型指针</code>、<code>函数指针</code>、<code>数组指针</code>等,例如:如果指针所指向的空间保存的是 int 类型,那么该指针就是 int 类型的指针。</li></ul></div><h2 id="_1-2-整数类型" tabindex="-1">1.2 整数类型 <a class="header-anchor" href="#_1-2-整数类型" aria-label="Permalink to "1.2 整数类型""></a></h2><h3 id="_1-2-1-概述" tabindex="-1">1.2.1 概述 <a class="header-anchor" href="#_1-2-1-概述" aria-label="Permalink to "1.2.1 概述""></a></h3><ul><li>整数类型简称整型,用于存储整数值,如:12、20、50 等。</li><li>根据所占<code>内存空间</code>大小的不同,可以将整数类型划分为:</li><li>① 短整型:</li></ul><table tabindex="0"><thead><tr><th>类型</th><th>存储空间(内存空间)</th><th>取值范围</th></tr></thead><tbody><tr><td>unsigned short (无符号短整型)</td><td>2 字节</td><td>0 ~ 65,535 (2^16 - 1)</td></tr><tr><td>[signed] short(有符号短整型,默认)</td><td>2 字节</td><td>-32,768 (- 2^15) ~ 32,767 (2^15 -1)</td></tr></tbody></table><ul><li>② 整型:</li></ul><table tabindex="0"><thead><tr><th>类型</th><th>存储空间(内存空间)</th><th>取值范围</th></tr></thead><tbody><tr><td>unsigned int(无符号整型)</td><td>4 字节(通常)</td><td>0 ~ 4294967295 (0 ~2^32 -1)</td></tr><tr><td>[signed] int(有符号整型,默认)</td><td>4 字节(通常)</td><td>-2147483648(- 2^31) ~ 2147483647 (2^31-1)</td></tr></tbody></table><ul><li>③ 长整型:</li></ul><table tabindex="0"><thead><tr><th>类型</th><th>存储空间(内存空间)</th><th>取值范围</th></tr></thead><tbody><tr><td>unsigned long(无符号长整型)</td><td>4 字节(通常)</td><td>0 ~2^32 -1</td></tr><tr><td>[signed] long(有符号长整型,默认)</td><td>4 字节(通常)</td><td>- 2^31 ~ 2^31-1</td></tr></tbody></table><ul><li>④ 长长整型:</li></ul><table tabindex="0"><thead><tr><th>类型</th><th>存储空间(内存空间)</th><th>取值范围</th></tr></thead><tbody><tr><td>unsigned long long(无符号长整型)</td><td>8 字节(通常)</td><td>0 ~2^64 -1</td></tr><tr><td>[signed] long long(有符号长整型,默认)</td><td>8 字节(通常)</td><td>- 2^63 ~ 2^63-1</td></tr></tbody></table><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① C 语言默认没有规定各种数据类型所占存储单元的长度,但是通常需要遵守:<code>sizeof(short int) ≤ sizeof(int) ≤ sizeof(long int) ≤ sizeof(long long)</code> ,具体的存储空间由编译系统自行决定;其中,sizeof 是测量类型或变量、常量长度的运算符。</li><li>② short 至少 2 个字节,long 至少 4 个字节。</li><li>③ 之所以这么规定,是为了可以让 C 语言长久使用,因为目前主流的 CPU 都是 64 位,但是在 C语言刚刚出现的时候,CPU 还是以 8 位和 16 位为主。如果当时就将整型定死为 8 位或 16 位,那么现在我们肯定不会再学习 C 语言了。</li><li>④ 整型分为有符号 signed 和无符号 unsigned 两种,默认是 signed。</li><li>⑤ 在实际开发中,<code>最常用的整数类型</code>就是 <code>int</code> 类型了,如果取值范围不够,就使用 long 或 long long 。</li><li>⑥ C 语言中的<code>格式占位符</code>非常多,只需要大致了解即可;因为,我们在实际开发中,一般都会使用 C++ 或 Rust 以及其它的高级编程语言,如:Java 等,早已经解决了需要通过<code>格式占位符</code>来输入和输出变量。</li></ul></div><h3 id="_1-2-2-短整型-了解" tabindex="-1">1.2.2 短整型(了解) <a class="header-anchor" href="#_1-2-2-短整型-了解" aria-label="Permalink to "1.2.2 短整型(了解)""></a></h3><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;">unsigned</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> short</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </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 style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 无符号短整型</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-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;">short</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</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 style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 有符号短整型</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 有符号表示的是正数、负数和 0 ,即有正负号。无符号表示的是 0 和正数,即正整数,没有符号。</li><li>② 在 <code>printf</code> 中<code>无符号短整型(unsigned short)</code>的<code>格式占位符</code>是 <code>%hu</code> ,<code>有符号短整型(signed short)</code>的<code>格式占位符</code>是 <code>%hd</code> 。</li><li>③ 可以通过 <code>sizeof</code> 运算符获取<code>无符号短整型(unsigned short)</code> 和 <code>有符号短整型(signed short)</code> 的<code>存储空间(所占内存空间)</code>。</li><li>③ 可以通过 <code>#include <limits.h></code> 来获取 <code>无符号短整型(unsigned short)</code> 和<code>有符号短整型(signed short)</code>的<code>取值范围</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;"> <stdio.h></span></span>
|
import{_ as s,c as i,o as a,a5 as n}from"./chunks/framework.BE8if9e6.js";const l="/c/assets/1.L8V3GBrc.png",p="/c/assets/2.BkF1yWLn.png",t="/c/assets/3.CceY8r_n.png",h="/c/assets/4.DHaUgOwj.png",k="/c/assets/5.CXGaq_zh.png",e="/c/assets/6.BrZYAEEl.png",r="/c/assets/7.DpCroFHv.png",d="/c/assets/8.Cr7P0Gji.png",E="/c/assets/9.NlBmD7pA.png",c="/c/assets/10.ZiBq6Pno.png",g="/c/assets/11.DAgmsf-w.png",F="/c/assets/12.B2iC37fw.png",y="/c/assets/14.BlE3ZFud.png",u="/c/assets/15.CdvhiwcU.png",b="/c/assets/16.D74t3-Xt.png",o="/c/assets/17.DdAZIfeP.png",C="/c/assets/18.B4Zfj2jX.png",m="/c/assets/19.IfpA0D5n.png",B="/c/assets/20.CfIzYazX.png",A="/c/assets/21.eHnZcbpI.png",D="/c/assets/22.BNoKlM4o.png",v="/c/assets/23.CMVtwrqr.png",q="/c/assets/24.CN19KJG7.png",f="/c/assets/25.BIhiJHjz.png",_="/c/assets/26.A_E4n4g8.png",x="/c/assets/27.Bv4qFbwF.png",z="/c/assets/28.IKaazo2J.png",w="/c/assets/29.CGTVELeO.png",I="/c/assets/30.Bz4_lEH0.gif",P="/c/assets/31.CcDWE4nn.png",T="/c/assets/32.B7y2_JVX.gif",N="/c/assets/33.Btcc3rs2.gif",L="/c/assets/34.CR4ARW8y.png",O="/c/assets/33.Btcc3rs2.gif",S="/c/assets/36.DOX3ymYP.gif",U="/c/assets/37.Cie9_tkP.gif",M="/c/assets/38.DLjH9Ges.png",$=JSON.parse('{"title":"第一章:数据类型(⭐)","description":"","frontmatter":{},"headers":[],"relativePath":"notes/01_c-basic/03_xdx/index.md","filePath":"notes/01_c-basic/03_xdx/index.md","lastUpdated":1721697767000}'),X={name:"notes/01_c-basic/03_xdx/index.md"},R=n('<h1 id="第一章-数据类型-⭐" tabindex="-1">第一章:数据类型(⭐) <a class="header-anchor" href="#第一章-数据类型-⭐" aria-label="Permalink to "第一章:数据类型(⭐)""></a></h1><h2 id="_1-1-概述" tabindex="-1">1.1 概述 <a class="header-anchor" href="#_1-1-概述" aria-label="Permalink to "1.1 概述""></a></h2><ul><li><p>根据<code>变量</code>中<code>存储</code>的<code>值</code>的<code>不同</code>,我们可以将<code>变量</code>分为两类:</p><ul><li><code>普通变量</code>:变量所对应的内存中存储的是<code>普通值</code>。</li><li><code>指针变量</code>:变量所对应的内存中存储的是<code>另一个变量的地址</code>。</li></ul></li><li><p>如下图所示:</p></li></ul><p><img src="'+l+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>普通变量和指针变量的相同点:</p><ul><li>普通变量有内存空间,指针变量也有内存空间。</li><li>普通变量有内存地址,指针变量也有内存地址。</li><li>普通变量所对应的内存空间中有值,指针变量所对应的内存空间中也有值。</li></ul><p>普通变量和指针变量的不同点:</p><ul><li>普通变量所对应的内存空间存储的是普通的值,如:整数、小数、字符等;指针变量所对应的内存空间存储的是另外一个变量的地址。</li><li>普通变量有普通变量的运算方式,而指针变量有指针变量的运算方式(后续讲解)。</li></ul></div><ul><li>那么,在 C 语言中变量的数据类型就可以这么划分,如下所示:</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>根据<code>普通变量</code>中<code>存储</code>的<code>值</code>的类型不同,可以将<code>普通变量类型</code>划分为<code>基本数据类型</code>(整型、字符类型、浮点类型、布尔类型)和<code>复合数据类型</code>(数组类型、结构体类型、共用体类型、枚举类型)。</li><li>根据<code>指针变量</code>所<code>指向空间</code>中<code>存储</code>的<code>值</code>的类型不同,可以将<code>指针类型</code>分为<code>基本数据类型指针</code>、<code>复合数据类型指针</code>、<code>函数指针</code>、<code>数组指针</code>等,例如:如果指针所指向的空间保存的是 int 类型,那么该指针就是 int 类型的指针。</li></ul></div><h2 id="_1-2-整数类型" tabindex="-1">1.2 整数类型 <a class="header-anchor" href="#_1-2-整数类型" aria-label="Permalink to "1.2 整数类型""></a></h2><h3 id="_1-2-1-概述" tabindex="-1">1.2.1 概述 <a class="header-anchor" href="#_1-2-1-概述" aria-label="Permalink to "1.2.1 概述""></a></h3><ul><li>整数类型简称整型,用于存储整数值,如:12、20、50 等。</li><li>根据所占<code>内存空间</code>大小的不同,可以将整数类型划分为:</li><li>① 短整型:</li></ul><table tabindex="0"><thead><tr><th>类型</th><th>存储空间(内存空间)</th><th>取值范围</th></tr></thead><tbody><tr><td>unsigned short (无符号短整型)</td><td>2 字节</td><td>0 ~ 65,535 (2^16 - 1)</td></tr><tr><td>[signed] short(有符号短整型,默认)</td><td>2 字节</td><td>-32,768 (- 2^15) ~ 32,767 (2^15 -1)</td></tr></tbody></table><ul><li>② 整型:</li></ul><table tabindex="0"><thead><tr><th>类型</th><th>存储空间(内存空间)</th><th>取值范围</th></tr></thead><tbody><tr><td>unsigned int(无符号整型)</td><td>4 字节(通常)</td><td>0 ~ 4294967295 (0 ~2^32 -1)</td></tr><tr><td>[signed] int(有符号整型,默认)</td><td>4 字节(通常)</td><td>-2147483648(- 2^31) ~ 2147483647 (2^31-1)</td></tr></tbody></table><ul><li>③ 长整型:</li></ul><table tabindex="0"><thead><tr><th>类型</th><th>存储空间(内存空间)</th><th>取值范围</th></tr></thead><tbody><tr><td>unsigned long(无符号长整型)</td><td>4 字节(通常)</td><td>0 ~2^32 -1</td></tr><tr><td>[signed] long(有符号长整型,默认)</td><td>4 字节(通常)</td><td>- 2^31 ~ 2^31-1</td></tr></tbody></table><ul><li>④ 长长整型:</li></ul><table tabindex="0"><thead><tr><th>类型</th><th>存储空间(内存空间)</th><th>取值范围</th></tr></thead><tbody><tr><td>unsigned long long(无符号长整型)</td><td>8 字节(通常)</td><td>0 ~2^64 -1</td></tr><tr><td>[signed] long long(有符号长整型,默认)</td><td>8 字节(通常)</td><td>- 2^63 ~ 2^63-1</td></tr></tbody></table><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① C 语言默认没有规定各种数据类型所占存储单元的长度,但是通常需要遵守:<code>sizeof(short int) ≤ sizeof(int) ≤ sizeof(long int) ≤ sizeof(long long)</code> ,具体的存储空间由编译系统自行决定;其中,sizeof 是测量类型或变量、常量长度的运算符。</li><li>② short 至少 2 个字节,long 至少 4 个字节。</li><li>③ 之所以这么规定,是为了可以让 C 语言长久使用,因为目前主流的 CPU 都是 64 位,但是在 C语言刚刚出现的时候,CPU 还是以 8 位和 16 位为主。如果当时就将整型定死为 8 位或 16 位,那么现在我们肯定不会再学习 C 语言了。</li><li>④ 整型分为有符号 signed 和无符号 unsigned 两种,默认是 signed。</li><li>⑤ 在实际开发中,<code>最常用的整数类型</code>就是 <code>int</code> 类型了,如果取值范围不够,就使用 long 或 long long 。</li><li>⑥ C 语言中的<code>格式占位符</code>非常多,只需要大致了解即可;因为,我们在实际开发中,一般都会使用 C++ 或 Rust 以及其它的高级编程语言,如:Java 等,早已经解决了需要通过<code>格式占位符</code>来输入和输出变量。</li></ul></div><h3 id="_1-2-2-短整型-了解" tabindex="-1">1.2.2 短整型(了解) <a class="header-anchor" href="#_1-2-2-短整型-了解" aria-label="Permalink to "1.2.2 短整型(了解)""></a></h3><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;">unsigned</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> short</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </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 style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 无符号短整型</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-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;">short</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> x </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</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 style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 有符号短整型</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 有符号表示的是正数、负数和 0 ,即有正负号。无符号表示的是 0 和正数,即正整数,没有符号。</li><li>② 在 <code>printf</code> 中<code>无符号短整型(unsigned short)</code>的<code>格式占位符</code>是 <code>%hu</code> ,<code>有符号短整型(signed short)</code>的<code>格式占位符</code>是 <code>%hd</code> 。</li><li>③ 可以通过 <code>sizeof</code> 运算符获取<code>无符号短整型(unsigned short)</code> 和 <code>有符号短整型(signed short)</code> 的<code>存储空间(所占内存空间)</code>。</li><li>③ 可以通过 <code>#include <limits.h></code> 来获取 <code>无符号短整型(unsigned short)</code> 和<code>有符号短整型(signed short)</code>的<code>取值范围</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;"> <stdio.h></span></span>
|
||||||
<span class="line"></span>
|
<span class="line"></span>
|
||||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
|
<span class="line"><span style="--shiki-light:#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>
|
||||||
@ -358,7 +358,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;">"unsigned char 范围是[0,</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;">"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, UCHAR_MAX);</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // [0,255]</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;">"unsigned char 范围是[0,</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;">"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, UCHAR_MAX);</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // [0,255]</span></span>
|
||||||
<span class="line"></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:#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></div></div><h3 id="_1-4-3-字符类型的本质" tabindex="-1">1.4.3 字符类型的本质 <a class="header-anchor" href="#_1-4-3-字符类型的本质" aria-label="Permalink to "1.4.3 字符类型的本质""></a></h3><ul><li>在 C 语言中,char 本质上就是一个整数,是 ASCII 码中对应的数字,占用的内存大小是 1 个字节(存储空间),所以 char 类型也可以进行数学运算。</li></ul><p><img src="`+E+'" alt=""></p><ul><li>char 类型同样分为 signed char(无符号)和 unsigned char(有符号),其中 signed char 取值范围-128 ~ 127,unsigned char取值范围 0 ~ 255,默认是否带符号取决于当前运行环境。</li><li><code>字符类型的数据</code>在计算机中<code>存储</code>和<code>读取</code>的过程,如下所示:</li></ul><p><img src="'+c+`" alt=""></p><ul><li>示例:</li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> <limits.h></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></div></div><h3 id="_1-4-3-字符类型的本质" tabindex="-1">1.4.3 字符类型的本质 <a class="header-anchor" href="#_1-4-3-字符类型的本质" aria-label="Permalink to "1.4.3 字符类型的本质""></a></h3><ul><li>在 C 语言中,char 本质上就是一个整数,是 ASCII 码中对应的数字,占用的内存大小是 1 个字节(存储空间),所以 char 类型也可以进行数学运算。</li></ul><p><img src="`+E+'" alt=""></p><ul><li>char 类型同样分为 signed char(无符号)和 unsigned char(有符号),其中 signed char 取值范围 -128 ~ 127,unsigned char 取值范围 0 ~ 255,默认是否带符号取决于当前运行环境。</li><li><code>字符类型的数据</code>在计算机中<code>存储</code>和<code>读取</code>的过程,如下所示:</li></ul><p><img src="'+c+`" alt=""></p><ul><li>示例:</li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> <limits.h></span></span>
|
||||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> <stdio.h></span></span>
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> <stdio.h></span></span>
|
||||||
<span class="line"></span>
|
<span class="line"></span>
|
||||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
|
<span class="line"><span style="--shiki-light:#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>
|
@ -1 +1 @@
|
|||||||
import{_ as s,c as i,o as a,a5 as n}from"./chunks/framework.BE8if9e6.js";const l="/c/assets/1.L8V3GBrc.png",p="/c/assets/2.BkF1yWLn.png",t="/c/assets/3.CceY8r_n.png",h="/c/assets/4.DHaUgOwj.png",k="/c/assets/5.CXGaq_zh.png",e="/c/assets/6.BrZYAEEl.png",r="/c/assets/7.DpCroFHv.png",d="/c/assets/8.Cr7P0Gji.png",E="/c/assets/9.NlBmD7pA.png",c="/c/assets/10.ZiBq6Pno.png",g="/c/assets/11.DAgmsf-w.png",F="/c/assets/12.B2iC37fw.png",y="/c/assets/14.BlE3ZFud.png",u="/c/assets/15.CdvhiwcU.png",b="/c/assets/16.D74t3-Xt.png",o="/c/assets/17.DdAZIfeP.png",C="/c/assets/18.B4Zfj2jX.png",m="/c/assets/19.IfpA0D5n.png",B="/c/assets/20.CfIzYazX.png",A="/c/assets/21.eHnZcbpI.png",D="/c/assets/22.BNoKlM4o.png",v="/c/assets/23.CMVtwrqr.png",q="/c/assets/24.CN19KJG7.png",f="/c/assets/25.BIhiJHjz.png",_="/c/assets/26.A_E4n4g8.png",x="/c/assets/27.Bv4qFbwF.png",z="/c/assets/28.IKaazo2J.png",w="/c/assets/29.CGTVELeO.png",I="/c/assets/30.Bz4_lEH0.gif",P="/c/assets/31.CcDWE4nn.png",T="/c/assets/32.B7y2_JVX.gif",N="/c/assets/33.Btcc3rs2.gif",L="/c/assets/34.CR4ARW8y.png",O="/c/assets/33.Btcc3rs2.gif",S="/c/assets/36.DOX3ymYP.gif",U="/c/assets/37.Cie9_tkP.gif",M="/c/assets/38.DLjH9Ges.png",$=JSON.parse('{"title":"第一章:数据类型(⭐)","description":"","frontmatter":{},"headers":[],"relativePath":"notes/01_c-basic/03_xdx/index.md","filePath":"notes/01_c-basic/03_xdx/index.md","lastUpdated":1721377218000}'),X={name:"notes/01_c-basic/03_xdx/index.md"},R=n("",333),j=[R];function G(H,J,K,V,Z,W){return a(),i("div",null,j)}const Q=s(X,[["render",G]]);export{$ as __pageData,Q as default};
|
import{_ as s,c as i,o as a,a5 as n}from"./chunks/framework.BE8if9e6.js";const l="/c/assets/1.L8V3GBrc.png",p="/c/assets/2.BkF1yWLn.png",t="/c/assets/3.CceY8r_n.png",h="/c/assets/4.DHaUgOwj.png",k="/c/assets/5.CXGaq_zh.png",e="/c/assets/6.BrZYAEEl.png",r="/c/assets/7.DpCroFHv.png",d="/c/assets/8.Cr7P0Gji.png",E="/c/assets/9.NlBmD7pA.png",c="/c/assets/10.ZiBq6Pno.png",g="/c/assets/11.DAgmsf-w.png",F="/c/assets/12.B2iC37fw.png",y="/c/assets/14.BlE3ZFud.png",u="/c/assets/15.CdvhiwcU.png",b="/c/assets/16.D74t3-Xt.png",o="/c/assets/17.DdAZIfeP.png",C="/c/assets/18.B4Zfj2jX.png",m="/c/assets/19.IfpA0D5n.png",B="/c/assets/20.CfIzYazX.png",A="/c/assets/21.eHnZcbpI.png",D="/c/assets/22.BNoKlM4o.png",v="/c/assets/23.CMVtwrqr.png",q="/c/assets/24.CN19KJG7.png",f="/c/assets/25.BIhiJHjz.png",_="/c/assets/26.A_E4n4g8.png",x="/c/assets/27.Bv4qFbwF.png",z="/c/assets/28.IKaazo2J.png",w="/c/assets/29.CGTVELeO.png",I="/c/assets/30.Bz4_lEH0.gif",P="/c/assets/31.CcDWE4nn.png",T="/c/assets/32.B7y2_JVX.gif",N="/c/assets/33.Btcc3rs2.gif",L="/c/assets/34.CR4ARW8y.png",O="/c/assets/33.Btcc3rs2.gif",S="/c/assets/36.DOX3ymYP.gif",U="/c/assets/37.Cie9_tkP.gif",M="/c/assets/38.DLjH9Ges.png",$=JSON.parse('{"title":"第一章:数据类型(⭐)","description":"","frontmatter":{},"headers":[],"relativePath":"notes/01_c-basic/03_xdx/index.md","filePath":"notes/01_c-basic/03_xdx/index.md","lastUpdated":1721697767000}'),X={name:"notes/01_c-basic/03_xdx/index.md"},R=n("",333),j=[R];function G(H,J,K,V,Z,W){return a(),i("div",null,j)}const Q=s(X,[["render",G]]);export{$ as __pageData,Q as default};
|
@ -1 +1 @@
|
|||||||
{"index.md":"uFk6fSzW","notes_index.md":"3bIiHjBr","notes_01_c-basic_01_xdx_index.md":"DA3nuW_4","notes_01_c-basic_02_xdx_index.md":"Cxyt4HEd","notes_01_c-basic_04_xdx_index.md":"CJSxDj__","notes_01_c-basic_03_xdx_index.md":"CgLUd3rz"}
|
{"index.md":"uFk6fSzW","notes_01_c-basic_01_xdx_index.md":"DA3nuW_4","notes_01_c-basic_02_xdx_index.md":"Cxyt4HEd","notes_index.md":"3bIiHjBr","notes_01_c-basic_04_xdx_index.md":"CJSxDj__","notes_01_c-basic_03_xdx_index.md":"No5lEq6U"}
|
||||||
|
@ -8,10 +8,10 @@
|
|||||||
<meta name="generator" content="VitePress v1.2.3">
|
<meta name="generator" content="VitePress v1.2.3">
|
||||||
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
|
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
|
||||||
|
|
||||||
<script type="module" src="/c/assets/app.DrgBDoBl.js"></script>
|
<script type="module" src="/c/assets/app.DN8pJb91.js"></script>
|
||||||
<link rel="preload" href="/c/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
|
<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/framework.BE8if9e6.js">
|
||||||
<link rel="modulepreload" href="/c/assets/chunks/theme.DeJoNarU.js">
|
<link rel="modulepreload" href="/c/assets/chunks/theme.CbwtpqME.js">
|
||||||
<link rel="modulepreload" href="/c/assets/index.md.uFk6fSzW.lean.js">
|
<link rel="modulepreload" href="/c/assets/index.md.uFk6fSzW.lean.js">
|
||||||
<link rel="shortcut icon" href="/c//logo.svg">
|
<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="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>
|
</head>
|
||||||
<body>
|
<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>
|
<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("{\"index.md\":\"uFk6fSzW\",\"notes_index.md\":\"3bIiHjBr\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cxyt4HEd\",\"notes_01_c-basic_04_xdx_index.md\":\"CJSxDj__\",\"notes_01_c-basic_03_xdx_index.md\":\"CgLUd3rz\"}");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\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"uFk6fSzW\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cxyt4HEd\",\"notes_index.md\":\"3bIiHjBr\",\"notes_01_c-basic_04_xdx_index.md\":\"CJSxDj__\",\"notes_01_c-basic_03_xdx_index.md\":\"No5lEq6U\"}");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\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -8,10 +8,10 @@
|
|||||||
<meta name="generator" content="VitePress v1.2.3">
|
<meta name="generator" content="VitePress v1.2.3">
|
||||||
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
|
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
|
||||||
|
|
||||||
<script type="module" src="/c/assets/app.DrgBDoBl.js"></script>
|
<script type="module" src="/c/assets/app.DN8pJb91.js"></script>
|
||||||
<link rel="preload" href="/c/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
|
<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/framework.BE8if9e6.js">
|
||||||
<link rel="modulepreload" href="/c/assets/chunks/theme.DeJoNarU.js">
|
<link rel="modulepreload" href="/c/assets/chunks/theme.CbwtpqME.js">
|
||||||
<link rel="modulepreload" href="/c/assets/notes_01_c-basic_01_xdx_index.md.DA3nuW_4.lean.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">
|
<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="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>.idea</span></span>
|
||||||
<span class="line"><span>cmake-build-*</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 "7.6 演示""></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 "第八章:C 语言的编译过程(⭐)""></a></h1><h2 id="_8-1-概述" tabindex="-1">8.1 概述 <a class="header-anchor" href="#_8-1-概述" aria-label="Permalink to "8.1 概述""></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 <stdio.h></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><stdio.h></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 "8.2 GCC 编译器的介绍""></a></h2><ul><li>编辑器,如:vim 、vscode 等,是指我们用它来编写源程序的(编辑代码),而我们写的代码语句,电脑是不懂的,我们需要把它转成电脑能懂的语句,编译器就是这样的转化工具。换言之,我们用编辑器编写程序,由编译器编译后才可以运行!</li><li>编译器是将易于编写、阅读和维护的高级计算机语言翻译为计算机能解读、运行的低级机器语言的程序。</li><li>gcc(GNU Compiler Collection,GNU 编译器套件),是由 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 "8.3 通过 gcc 直接生成可执行文件""></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 "8.4 通过 gcc 分步编译""></a></h2><h3 id="_8-3-1-概述" tabindex="-1">8.3.1 概述 <a class="header-anchor" href="#_8-3-1-概述" aria-label="Permalink to "8.3.1 概述""></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 "8.4.2 应用示例""></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>
|
<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 "7.6 演示""></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 "第八章:C 语言的编译过程(⭐)""></a></h1><h2 id="_8-1-概述" tabindex="-1">8.1 概述 <a class="header-anchor" href="#_8-1-概述" aria-label="Permalink to "8.1 概述""></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 <stdio.h></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><stdio.h></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 "8.2 GCC 编译器的介绍""></a></h2><ul><li>编辑器,如:vim 、vscode 等,是指我们用它来编写源程序的(编辑代码),而我们写的代码语句,电脑是不懂的,我们需要把它转成电脑能懂的语句,编译器就是这样的转化工具。换言之,我们用编辑器编写程序,由编译器编译后才可以运行!</li><li>编译器是将易于编写、阅读和维护的高级计算机语言翻译为计算机能解读、运行的低级机器语言的程序。</li><li>gcc(GNU Compiler Collection,GNU 编译器套件),是由 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 "8.3 通过 gcc 直接生成可执行文件""></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 "8.4 通过 gcc 分步编译""></a></h2><h3 id="_8-3-1-概述" tabindex="-1">8.3.1 概述 <a class="header-anchor" href="#_8-3-1-概述" aria-label="Permalink to "8.3.1 概述""></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 "8.4.2 应用示例""></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("{\"index.md\":\"uFk6fSzW\",\"notes_index.md\":\"3bIiHjBr\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cxyt4HEd\",\"notes_01_c-basic_04_xdx_index.md\":\"CJSxDj__\",\"notes_01_c-basic_03_xdx_index.md\":\"CgLUd3rz\"}");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\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"uFk6fSzW\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cxyt4HEd\",\"notes_index.md\":\"3bIiHjBr\",\"notes_01_c-basic_04_xdx_index.md\":\"CJSxDj__\",\"notes_01_c-basic_03_xdx_index.md\":\"No5lEq6U\"}");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\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -8,10 +8,10 @@
|
|||||||
<meta name="generator" content="VitePress v1.2.3">
|
<meta name="generator" content="VitePress v1.2.3">
|
||||||
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
|
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
|
||||||
|
|
||||||
<script type="module" src="/c/assets/app.DrgBDoBl.js"></script>
|
<script type="module" src="/c/assets/app.DN8pJb91.js"></script>
|
||||||
<link rel="preload" href="/c/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
|
<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/framework.BE8if9e6.js">
|
||||||
<link rel="modulepreload" href="/c/assets/chunks/theme.DeJoNarU.js">
|
<link rel="modulepreload" href="/c/assets/chunks/theme.CbwtpqME.js">
|
||||||
<link rel="modulepreload" href="/c/assets/notes_01_c-basic_02_xdx_index.md.Cxyt4HEd.lean.js">
|
<link rel="modulepreload" href="/c/assets/notes_01_c-basic_02_xdx_index.md.Cxyt4HEd.lean.js">
|
||||||
<link rel="shortcut icon" href="/c//logo.svg">
|
<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="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,shrink-to-fit=no">
|
||||||
@ -256,7 +256,7 @@
|
|||||||
<span class="line"></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:#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 "3.3 进制的转换""></a></h2><h3 id="_3-3-1-概述" tabindex="-1">3.3.1 概述 <a class="header-anchor" href="#_3-3-1-概述" aria-label="Permalink to "3.3.1 概述""></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 "3.3.2 二进制和十进制的转换""></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 "3.3.2.1 二进制转换为十进制""></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 "3.3.2.2 十进制转换二进制""></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 "3.3.3 二进制转八进制""></a></h3><ul><li><p>规则:每 3 位二进制就是一个八进制。</p></li><li><p>示例:011 101 001 -> 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 "3.3.4 二进制转十六进制""></a></h3><ul><li><p>规则:每 4 位二进制就是一个十六进制。</p></li><li><p>示例:1110 1001 -> 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 "3.4 原码、反码和补码""></a></h2><h3 id="_3-4-1-概述" tabindex="-1">3.4.1 概述 <a class="header-anchor" href="#_3-4-1-概述" aria-label="Permalink to "3.4.1 概述""></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 "3.4.2 原码""></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 "3.4.3 反码""></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 "3.4.4 补码""></a></h3><ul><li><p>规则:</p><ul><li>正数的补码和它的原码相同。</li><li>负数的补码是在其反码的基础上 + 1 。</li></ul></li><li><p>+1 的补码,使用 8 位二进数来表示,就是:</p></li></ul><table tabindex="0"><thead><tr><th>十进制数</th><th>原码(8位二进制数)</th><th>反码(8位二进制数)</th><th>补码(8位二进制数)</th></tr></thead><tbody><tr><td>+1</td><td><code>0</code>000 0001</td><td><code>0</code>000 0001</td><td><code>0</code>000 0001</td></tr></tbody></table><ul><li>-1 的补码,使用 8 位二进数来表示,就是:</li></ul><table tabindex="0"><thead><tr><th>十进制数</th><th>原码(8位二进制数)</th><th>反码(8位二进制数)</th><th>补码(8位二进制数)</th></tr></thead><tbody><tr><td>-1</td><td><code>1</code>000 0001</td><td><code>1</code>111 1110</td><td><code>1</code>111 1111</td></tr></tbody></table><ul><li>如果 0 ,按照 <code>+0</code> 的情况进行处理,即:</li></ul><p><img src="/c/assets/29.COIOzcmT.png" alt=""></p><ul><li>如果 0 ,按照 <code>-0</code> 的情况进行处理,即:</li></ul><p><img src="/c/assets/30.Cu__mjav.png" alt=""></p><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li>① 补码表示法解决了<code>原码</code>和<code>反码</code>存在的<code>两种</code>零(<code>+0</code> 和 <code>-0</code>)的问题,即:在补码表示法中,只有<code>一个</code>零,即 0000 0000。</li><li>②补码使得<code>加法运算</code>和<code>减法运算</code>可以统一处理,通过将减法运算<code>转换</code>为加法运算,可以简化硬件设计,提高了运算效率。</li><li>③ 计算机底层<code>存储</code>和<code>计算</code>的都是<code>二进数的补码</code>。</li></ul></div><h3 id="_3-4-5-总结" tabindex="-1">3.4.5 总结 <a class="header-anchor" href="#_3-4-5-总结" aria-label="Permalink to "3.4.5 总结""></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 "3.5 计算机底层为什么使用补码?""></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-17T07:44:31.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/01_c-basic/03_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>
|
<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 "3.3 进制的转换""></a></h2><h3 id="_3-3-1-概述" tabindex="-1">3.3.1 概述 <a class="header-anchor" href="#_3-3-1-概述" aria-label="Permalink to "3.3.1 概述""></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 "3.3.2 二进制和十进制的转换""></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 "3.3.2.1 二进制转换为十进制""></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 "3.3.2.2 十进制转换二进制""></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 "3.3.3 二进制转八进制""></a></h3><ul><li><p>规则:每 3 位二进制就是一个八进制。</p></li><li><p>示例:011 101 001 -> 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 "3.3.4 二进制转十六进制""></a></h3><ul><li><p>规则:每 4 位二进制就是一个十六进制。</p></li><li><p>示例:1110 1001 -> 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 "3.4 原码、反码和补码""></a></h2><h3 id="_3-4-1-概述" tabindex="-1">3.4.1 概述 <a class="header-anchor" href="#_3-4-1-概述" aria-label="Permalink to "3.4.1 概述""></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 "3.4.2 原码""></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 "3.4.3 反码""></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 "3.4.4 补码""></a></h3><ul><li><p>规则:</p><ul><li>正数的补码和它的原码相同。</li><li>负数的补码是在其反码的基础上 + 1 。</li></ul></li><li><p>+1 的补码,使用 8 位二进数来表示,就是:</p></li></ul><table tabindex="0"><thead><tr><th>十进制数</th><th>原码(8位二进制数)</th><th>反码(8位二进制数)</th><th>补码(8位二进制数)</th></tr></thead><tbody><tr><td>+1</td><td><code>0</code>000 0001</td><td><code>0</code>000 0001</td><td><code>0</code>000 0001</td></tr></tbody></table><ul><li>-1 的补码,使用 8 位二进数来表示,就是:</li></ul><table tabindex="0"><thead><tr><th>十进制数</th><th>原码(8位二进制数)</th><th>反码(8位二进制数)</th><th>补码(8位二进制数)</th></tr></thead><tbody><tr><td>-1</td><td><code>1</code>000 0001</td><td><code>1</code>111 1110</td><td><code>1</code>111 1111</td></tr></tbody></table><ul><li>如果 0 ,按照 <code>+0</code> 的情况进行处理,即:</li></ul><p><img src="/c/assets/29.COIOzcmT.png" alt=""></p><ul><li>如果 0 ,按照 <code>-0</code> 的情况进行处理,即:</li></ul><p><img src="/c/assets/30.Cu__mjav.png" alt=""></p><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li>① 补码表示法解决了<code>原码</code>和<code>反码</code>存在的<code>两种</code>零(<code>+0</code> 和 <code>-0</code>)的问题,即:在补码表示法中,只有<code>一个</code>零,即 0000 0000。</li><li>②补码使得<code>加法运算</code>和<code>减法运算</code>可以统一处理,通过将减法运算<code>转换</code>为加法运算,可以简化硬件设计,提高了运算效率。</li><li>③ 计算机底层<code>存储</code>和<code>计算</code>的都是<code>二进数的补码</code>。</li></ul></div><h3 id="_3-4-5-总结" tabindex="-1">3.4.5 总结 <a class="header-anchor" href="#_3-4-5-总结" aria-label="Permalink to "3.4.5 总结""></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 "3.5 计算机底层为什么使用补码?""></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-17T07:44:31.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/01_c-basic/03_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("{\"index.md\":\"uFk6fSzW\",\"notes_index.md\":\"3bIiHjBr\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cxyt4HEd\",\"notes_01_c-basic_04_xdx_index.md\":\"CJSxDj__\",\"notes_01_c-basic_03_xdx_index.md\":\"CgLUd3rz\"}");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\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"uFk6fSzW\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cxyt4HEd\",\"notes_index.md\":\"3bIiHjBr\",\"notes_01_c-basic_04_xdx_index.md\":\"CJSxDj__\",\"notes_01_c-basic_03_xdx_index.md\":\"No5lEq6U\"}");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\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -8,11 +8,11 @@
|
|||||||
<meta name="generator" content="VitePress v1.2.3">
|
<meta name="generator" content="VitePress v1.2.3">
|
||||||
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
|
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
|
||||||
|
|
||||||
<script type="module" src="/c/assets/app.DrgBDoBl.js"></script>
|
<script type="module" src="/c/assets/app.DN8pJb91.js"></script>
|
||||||
<link rel="preload" href="/c/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
|
<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/framework.BE8if9e6.js">
|
||||||
<link rel="modulepreload" href="/c/assets/chunks/theme.DeJoNarU.js">
|
<link rel="modulepreload" href="/c/assets/chunks/theme.CbwtpqME.js">
|
||||||
<link rel="modulepreload" href="/c/assets/notes_01_c-basic_03_xdx_index.md.CgLUd3rz.lean.js">
|
<link rel="modulepreload" href="/c/assets/notes_01_c-basic_03_xdx_index.md.No5lEq6U.lean.js">
|
||||||
<link rel="shortcut icon" href="/c//logo.svg">
|
<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="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="许大仙,许大仙的博客">
|
<meta name="keywords" content="许大仙,许大仙的博客">
|
||||||
@ -380,7 +380,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;">"unsigned char 范围是[0,</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;">"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, UCHAR_MAX);</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // [0,255]</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;">"unsigned char 范围是[0,</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;">"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, UCHAR_MAX);</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // [0,255]</span></span>
|
||||||
<span class="line"></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:#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></div></div><h3 id="_1-4-3-字符类型的本质" tabindex="-1">1.4.3 字符类型的本质 <a class="header-anchor" href="#_1-4-3-字符类型的本质" aria-label="Permalink to "1.4.3 字符类型的本质""></a></h3><ul><li>在 C 语言中,char 本质上就是一个整数,是 ASCII 码中对应的数字,占用的内存大小是 1 个字节(存储空间),所以 char 类型也可以进行数学运算。</li></ul><p><img src="/c/assets/9.NlBmD7pA.png" alt=""></p><ul><li>char 类型同样分为 signed char(无符号)和 unsigned char(有符号),其中 signed char 取值范围-128 ~ 127,unsigned char取值范围 0 ~ 255,默认是否带符号取决于当前运行环境。</li><li><code>字符类型的数据</code>在计算机中<code>存储</code>和<code>读取</code>的过程,如下所示:</li></ul><p><img src="/c/assets/10.ZiBq6Pno.png" alt=""></p><ul><li>示例:</li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> <limits.h></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></div></div><h3 id="_1-4-3-字符类型的本质" tabindex="-1">1.4.3 字符类型的本质 <a class="header-anchor" href="#_1-4-3-字符类型的本质" aria-label="Permalink to "1.4.3 字符类型的本质""></a></h3><ul><li>在 C 语言中,char 本质上就是一个整数,是 ASCII 码中对应的数字,占用的内存大小是 1 个字节(存储空间),所以 char 类型也可以进行数学运算。</li></ul><p><img src="/c/assets/9.NlBmD7pA.png" alt=""></p><ul><li>char 类型同样分为 signed char(无符号)和 unsigned char(有符号),其中 signed char 取值范围 -128 ~ 127,unsigned char 取值范围 0 ~ 255,默认是否带符号取决于当前运行环境。</li><li><code>字符类型的数据</code>在计算机中<code>存储</code>和<code>读取</code>的过程,如下所示:</li></ul><p><img src="/c/assets/10.ZiBq6Pno.png" alt=""></p><ul><li>示例:</li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> <limits.h></span></span>
|
||||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> <stdio.h></span></span>
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> <stdio.h></span></span>
|
||||||
<span class="line"></span>
|
<span class="line"></span>
|
||||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
|
<span class="line"><span style="--shiki-light:#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>
|
||||||
@ -788,8 +788,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;">"result = </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, result);</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // result = 110</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;">"result = </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, result);</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // result = 110</span></span>
|
||||||
<span class="line"></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:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
||||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div><h2 id="_2-8-运算符优先级" tabindex="-1">2.8 运算符优先级 <a class="header-anchor" href="#_2-8-运算符优先级" aria-label="Permalink to "2.8 运算符优先级""></a></h2><ul><li>C 语言中运算符的优先级,如下所示:</li></ul><table tabindex="0"><thead><tr><th><strong>优先级</strong></th><th><strong>运算符</strong></th><th><strong>名称或含义</strong></th><th><strong>结合方向</strong></th></tr></thead><tbody><tr><td><strong>1</strong></td><td><code>[]</code></td><td>数组下标</td><td>左到右</td></tr><tr><td></td><td><code>()</code></td><td>圆括号</td><td></td></tr><tr><td></td><td><code>.</code></td><td>成员选择(对象)</td><td></td></tr><tr><td></td><td><code>-></code></td><td>成员选择(指针)</td><td></td></tr><tr><td><strong>2</strong></td><td><code>-</code></td><td>负号运算符</td><td>右到左</td></tr><tr><td></td><td><code>(类型)</code></td><td>强制类型转换</td><td></td></tr><tr><td></td><td><code>++</code></td><td>自增运算符</td><td></td></tr><tr><td></td><td><code>--</code></td><td>自减运算符</td><td></td></tr><tr><td></td><td><code>*</code></td><td>取值运算符</td><td></td></tr><tr><td></td><td><code>&</code></td><td>取地址运算符</td><td></td></tr><tr><td></td><td><code>!</code></td><td>逻辑非运算符</td><td></td></tr><tr><td></td><td><code>~</code></td><td>按位取反运算符</td><td></td></tr><tr><td></td><td><code>sizeof</code></td><td>长度运算符</td><td></td></tr><tr><td><strong>3</strong></td><td><code>/</code></td><td>除</td><td>左到右</td></tr><tr><td></td><td><code>*</code></td><td>乘</td><td></td></tr><tr><td></td><td><code>%</code></td><td>余数(取模)</td><td></td></tr><tr><td><strong>4</strong></td><td><code>+</code></td><td>加</td><td>左到右</td></tr><tr><td></td><td><code>-</code></td><td>减</td><td></td></tr><tr><td><strong>5</strong></td><td><code><<</code></td><td>左移</td><td>左到右</td></tr><tr><td></td><td><code>>></code></td><td>右移</td><td></td></tr><tr><td><strong>6</strong></td><td><code>></code></td><td>大于</td><td>左到右</td></tr><tr><td></td><td><code>>=</code></td><td>大于等于</td><td></td></tr><tr><td></td><td><code><</code></td><td>小于</td><td></td></tr><tr><td></td><td><code><=</code></td><td>小于等于</td><td></td></tr><tr><td><strong>7</strong></td><td><code>==</code></td><td>等于</td><td>左到右</td></tr><tr><td></td><td><code>!=</code></td><td>不等于</td><td></td></tr><tr><td><strong>8</strong></td><td><code>&</code></td><td>按位与</td><td>左到右</td></tr><tr><td><strong>9</strong></td><td><code>^</code></td><td>按位异或</td><td>左到右</td></tr><tr><td><strong>10</strong></td><td><code>|</code></td><td>按位或</td><td>左到右</td></tr><tr><td><strong>11</strong></td><td><code>&&</code></td><td>逻辑与</td><td>左到右</td></tr><tr><td><strong>12</strong></td><td><code>||</code></td><td>逻辑或</td><td>左到右</td></tr><tr><td><strong>13</strong></td><td><code>?:</code></td><td>条件运算符</td><td>右到左</td></tr><tr><td><strong>14</strong></td><td><code>=</code></td><td>赋值运算符</td><td>右到左</td></tr><tr><td></td><td><code>/=</code></td><td>除后赋值</td><td></td></tr><tr><td></td><td><code>*=</code></td><td>乘后赋值</td><td></td></tr><tr><td></td><td><code>%=</code></td><td>取模后赋值</td><td></td></tr><tr><td></td><td><code>+=</code></td><td>加后赋值</td><td></td></tr><tr><td></td><td><code>-=</code></td><td>减后赋值</td><td></td></tr><tr><td></td><td><code><<=</code></td><td>左移后赋值</td><td></td></tr><tr><td></td><td><code>>>=</code></td><td>右移后赋值</td><td></td></tr><tr><td></td><td><code>&=</code></td><td>按位与后赋值</td><td></td></tr><tr><td></td><td><code>^=</code></td><td>按位异或后赋值</td><td></td></tr><tr><td></td><td><code>|=</code></td><td>按位或后赋值</td><td></td></tr><tr><td><strong>15</strong></td><td><code>,</code></td><td>逗号运算符</td><td>左到右</td></tr></tbody></table><div class="warning custom-block github-alert"><p class="custom-block-title">WARNING</p><p></p><ul><li>① 不要过多的依赖运算符的优先级来控制表达式的执行顺序,这样可读性太差,尽量<code>使用小括号来控制</code>表达式的执行顺序。</li><li>② 不要把一个表达式写得过于复杂,如果一个表达式过于复杂,则把它<code>分成几步</code>来完成。</li><li>③ 运算符优先级不用刻意地去记忆,总体上:一元运算符 > 算术运算符 > 关系运算符 > 逻辑运算符 > 三元运算符 > 赋值运算符。</li></ul></div><h1 id="第三章-附录" tabindex="-1">第三章:附录 <a class="header-anchor" href="#第三章-附录" aria-label="Permalink to "第三章:附录""></a></h1><h2 id="_3-1-字符集和字符集编码" tabindex="-1">3.1 字符集和字符集编码 <a class="header-anchor" href="#_3-1-字符集和字符集编码" aria-label="Permalink to "3.1 字符集和字符集编码""></a></h2><h3 id="_3-3-1-概述" tabindex="-1">3.3.1 概述 <a class="header-anchor" href="#_3-3-1-概述" aria-label="Permalink to "3.3.1 概述""></a></h3><ul><li>字符集和字符集编码(简称编码)计算机系统中处理文本数据的两个基本概念,它们密切相关但又有区别。</li><li>字符集(Character Set)是一组字符的集合,其中每个字符都被分配了一个<code>唯一的编号</code>(通常是数字)。字符可以是字母、数字、符号、控制代码(如换行符)等。<code>字符集定义了可以表示的字符的范围</code>,但它并不直接定义如何将这些字符存储在计算机中。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>ASCII(美国信息交换标准代码)是最早期和最简单的字符集之一,它只包括了英文字母、数字和一些特殊字符,共 128 个字符。每个字符都分配给了一个从 0 到 127 的数字。</p></div><ul><li>字符集编码(Character Encoding,简称编码)是一种方案或方法,<code>它定义了如何将字符集中的字符转换为计算机存储和传输的数据(通常是一串二进制数字)</code>。简而言之,编码是字符到二进制数据之间的映射规则。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>ASCII编码方案定义了如何将 ASCII 字符集中的每个字符表示为 7 位的二进制数字。例如:大写字母<code>"A"</code>在ASCII 编码中表示为二进制的<code>1000001</code>,十进制的 <code>65</code> 。</p></div><ul><li><code>字符集</code>和<code>字符集编码</code>之间的关系如下:</li></ul><p><img src="/c/assets/29.CGTVELeO.png" alt=""></p><ul><li>Linux 中安装帮助手册:</li></ul><p><img src="/c/assets/30.Bz4_lEH0.gif" alt=""></p><h3 id="_3-3-2-ascii-编码" tabindex="-1">3.3.2 ASCII 编码 <a class="header-anchor" href="#_3-3-2-ascii-编码" aria-label="Permalink to "3.3.2 ASCII 编码""></a></h3><ul><li>从<code>冯·诺依曼</code>体系结构中,我们知道,计算机中所有的<code>数据</code>和<code>指令</code>都是以<code>二进制</code>的形式表示的;所以,计算机中对于文本数据的数据也是以二进制来存储的,那么对应的流程如下:</li></ul><p><img src="/c/assets/31.CcDWE4nn.png" alt=""></p><ul><li>我们知道,计算机是上个世纪 60 年代在美国研制成功的,为了实现字符和二进制的转换,美国就制定了一套字符编码,即英语字符和二进制位之间的关系,即 ASCII (American Standard Code for Information Interchange)编码: <ul><li>ASCII 编码只包括了英文字符、数字和一些特殊字符,一共 128 个字符,并且每个字符都分配了唯一的数字,范围是 0 - 127。</li><li>ASCII 编码中的每个字符都使用 7 位的二进制数字表示;但是,计算机中的存储的最小单位是 1 B = 8 位,那么最高位统一规定为 0 。</li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 其实,早期是没有字符集的概念的,只是后来为了解决乱码问题,而产生了字符集的概念。</li><li>② 对于英文体系来说,<code>a-zA-Z0-9</code>以及一些<code>特殊字符</code>一共 <code>128</code> 就可以满足实际存储需求;所以,在也是为什么 ASCII 码使用 7 位二进制(2^7 = 128 )来存储的。</li></ul></div><ul><li>在操作系统中,就内置了对应的编码表,Linux 也不例外;可以使用如下的命令查看:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">man</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ascii</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/32.B7y2_JVX.gif" alt=""></p><ul><li>其对应的 ASCII 编码表,如下所示:</li></ul><p><img src="/c/assets/33.Btcc3rs2.gif" alt=""></p><ul><li>但是,随着计算机的发展,计算机开始了东征之路,由美国传播到东方:</li></ul><p><img src="/c/assets/34.CR4ARW8y.png" alt=""></p><ul><li>先是传播到了欧洲,欧洲在兼容 ASCII 编码的基础上,推出了 ISO8859-1 编码,即: <ul><li>ISO8859-1 编码包括基本的拉丁字母表、数字、标点符号,以及西欧语言中特有的一些字符,如:法语中的 <code>è</code>、德语中的 <code>ü</code> 等。</li><li>ISO 8859-1 为每个字符分配一个单字节(8 位)编码,意味着它可以表示最多 256 (2^8)个不同的字符(编号从 0 到 255)。</li><li>ISO 8859-1 的前 128 个字符与 ASCII 编码完全一致,这使得 ASCII 编码的文本可以无缝转换为 ISO 8859-1 编码。</li></ul></li></ul><p><img src="/c/assets/33.Btcc3rs2.gif" alt=""></p><p><img src="/c/assets/36.DOX3ymYP.gif" alt=""></p><ul><li>计算机继续传播到了亚洲,亚洲(双字节)各个国家分别给出了自己国家对应的字符集编码,如: <ul><li>日本推出了 Shift-JIS 编码: <ul><li>单字节 ASCII 范围:0 - 127。</li><li>双字节范围: <ul><li>第一个字节:129 - 159 和 224 - 239 。</li><li>第二个字节:64 - 126 和 128 - 252 。</li></ul></li></ul></li><li>韩国推出了 EUC-KR 编码: <ul><li>单字节 ASCII 范围:0 - 127。</li><li>双字节范围:从 41281 - 65278。</li></ul></li><li>中国推出了 GBK 编码: <ul><li>单字节 ASCII 范围:0 - 127。</li><li>双字节范围:33088 - 65278 。</li></ul></li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 通过上面日本、韩国、中国的编码十进制范围,我们可以看到,虽然这些编码系统在技术上的编码范围存在重叠(特别是在高位字节区域),但因为它们各自支持的字符集完全不同,所以实际上它们并不直接冲突。</li><li>② 但是,如果一个中国人通过 GBK 编码写的文章,通过邮件发送给韩国人,因为韩国和中国在字符集编码上的高位字节有重叠部分,必然会造成歧义。</li></ul></div><h3 id="_3-3-3-unicode-编码" tabindex="-1">3.3.3 Unicode 编码 <a class="header-anchor" href="#_3-3-3-unicode-编码" aria-label="Permalink to "3.3.3 Unicode 编码""></a></h3><ul><li><p>在 Unicode 之前,世界上存在着数百种不同的编码系统,每一种编码系统都是为了支持特定语言或一组语言的字符集。这些编码系统,包括:ASCII、ISO 8859 系列、GBK、Shift-JIS、EUC-KR 等,它们各自有不同的字符范围和编码方式。这种多样性虽然在局部范围内解决了字符表示的问题,但也带来了以下几个方面的挑战:</p><ul><li><code>编码冲突</code>:由于不同的编码系统可以为相同的字节值分配不同的字符,因此在不同编码之间转换文本时,如果没有正确处理编码信息,就很容易产生乱码。这种编码冲突在尝试处理多种语言的文本时尤为突出。</li><li><code>编码的复杂性</code>:随着全球化的发展,软件和系统需要支持越来越多的语言,这就要求开发者和系统同时处理多种不同的编码系统。这不仅增加了开发和维护的复杂性,而且也增加了出错的风险。</li><li><code>资源限制</code>:在早期计算机技术中,内存和存储资源相对有限。不同的编码标准要求系统存储多套字符集数据,这无疑增加了对有限资源的消耗。</li><li>……</li></ul></li><li><p>针对上述的种种问题,为了推行全球化,Unicode 应运而生,Unicode 的核心规则和设计原则是建立一个全球统一的字符集,使得世界上所有的文字和符号都能被唯一地识别和使用,无论使用者位于何地或使用何种语言。这套规则包括了字符的编码、表示、处理和转换机制,旨在确保不同系统和软件间能够无缝交换和处理文本数据。</p><ul><li><code>通用字符集 (UCS)</code>:Unicode 为每一个字符分配一个唯一的编号(称为<code>“码点”</code>)。这些码点被组织在一个统一的字符集中,官方称之为 “通用字符集”(Universal Character Set,UCS)。码点通常表示为 <code>U+</code> 后跟一个十六进制数,例如:<code>U+0041</code> 代表大写的英文字母 <code>“A”</code>。</li><li><code>编码平面和区段</code>:Unicode 码点被划分为多个 “平面(Planes)”,每个平面包含 65536(16^4)个码点。目前,Unicode定义了 17 个平面(从 0 到16),每个平面被分配了一个编号,从 “基本多文种平面(BMP)” 的 0 开始,到 16 号平面结束。这意味着 Unicode 理论上可以支持超过 110万(17*65536)个码点。</li></ul></li><li><p>Unicode 仅仅只是字符集,给每个字符设置了唯一的数字编号而已,却没有给出这些数字编号实际如何存储,可以通过如下命令查看:</p></li></ul><p><img src="/c/assets/37.Cie9_tkP.gif" alt=""></p><ul><li>为了在计算机系统中表示 Unicode 字符,定义了几种编码方案,这些方案包括 UTF-8、UTF-16 和 UTF-32 等。 <ul><li><strong>UTF-8</strong>:使用 1 - 4 个字节表示每个 Unicode 字符,兼容 ASCII,是网络上最常用的编码。</li><li><strong>UTF-16</strong>:使用 2 - 4 个字节表示每个 Unicode 字符,适合于需要经常处理基本多文种平面之外字符的应用。</li><li><strong>UTF-32</strong>:使用固定的 4 个字节表示每个 Unicode 字符,简化了字符处理,但增加了存储空间的需求。</li></ul></li><li><code>Unicode 字符集</code>和对应的<code>UTF-8 字符编码</code>之间的关系,如下所示:</li></ul><p><img src="/c/assets/38.DLjH9Ges.png" alt=""></p></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-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-19T08:20:18.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/02_xdx/" data-v-d4a0bba5><!--[--><span class="desc" data-v-d4a0bba5>上一篇</span><span class="title" data-v-d4a0bba5>变量和进制</span><!--]--></a></div><div class="pager" data-v-d4a0bba5><a class="VPLink link pager-link next" href="/c/notes/01_c-basic/04_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>
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div><h2 id="_2-8-运算符优先级" tabindex="-1">2.8 运算符优先级 <a class="header-anchor" href="#_2-8-运算符优先级" aria-label="Permalink to "2.8 运算符优先级""></a></h2><ul><li>C 语言中运算符的优先级,如下所示:</li></ul><table tabindex="0"><thead><tr><th><strong>优先级</strong></th><th><strong>运算符</strong></th><th><strong>名称或含义</strong></th><th><strong>结合方向</strong></th></tr></thead><tbody><tr><td><strong>1</strong></td><td><code>[]</code></td><td>数组下标</td><td>左到右</td></tr><tr><td></td><td><code>()</code></td><td>圆括号</td><td></td></tr><tr><td></td><td><code>.</code></td><td>成员选择(对象)</td><td></td></tr><tr><td></td><td><code>-></code></td><td>成员选择(指针)</td><td></td></tr><tr><td><strong>2</strong></td><td><code>-</code></td><td>负号运算符</td><td>右到左</td></tr><tr><td></td><td><code>(类型)</code></td><td>强制类型转换</td><td></td></tr><tr><td></td><td><code>++</code></td><td>自增运算符</td><td></td></tr><tr><td></td><td><code>--</code></td><td>自减运算符</td><td></td></tr><tr><td></td><td><code>*</code></td><td>取值运算符</td><td></td></tr><tr><td></td><td><code>&</code></td><td>取地址运算符</td><td></td></tr><tr><td></td><td><code>!</code></td><td>逻辑非运算符</td><td></td></tr><tr><td></td><td><code>~</code></td><td>按位取反运算符</td><td></td></tr><tr><td></td><td><code>sizeof</code></td><td>长度运算符</td><td></td></tr><tr><td><strong>3</strong></td><td><code>/</code></td><td>除</td><td>左到右</td></tr><tr><td></td><td><code>*</code></td><td>乘</td><td></td></tr><tr><td></td><td><code>%</code></td><td>余数(取模)</td><td></td></tr><tr><td><strong>4</strong></td><td><code>+</code></td><td>加</td><td>左到右</td></tr><tr><td></td><td><code>-</code></td><td>减</td><td></td></tr><tr><td><strong>5</strong></td><td><code><<</code></td><td>左移</td><td>左到右</td></tr><tr><td></td><td><code>>></code></td><td>右移</td><td></td></tr><tr><td><strong>6</strong></td><td><code>></code></td><td>大于</td><td>左到右</td></tr><tr><td></td><td><code>>=</code></td><td>大于等于</td><td></td></tr><tr><td></td><td><code><</code></td><td>小于</td><td></td></tr><tr><td></td><td><code><=</code></td><td>小于等于</td><td></td></tr><tr><td><strong>7</strong></td><td><code>==</code></td><td>等于</td><td>左到右</td></tr><tr><td></td><td><code>!=</code></td><td>不等于</td><td></td></tr><tr><td><strong>8</strong></td><td><code>&</code></td><td>按位与</td><td>左到右</td></tr><tr><td><strong>9</strong></td><td><code>^</code></td><td>按位异或</td><td>左到右</td></tr><tr><td><strong>10</strong></td><td><code>|</code></td><td>按位或</td><td>左到右</td></tr><tr><td><strong>11</strong></td><td><code>&&</code></td><td>逻辑与</td><td>左到右</td></tr><tr><td><strong>12</strong></td><td><code>||</code></td><td>逻辑或</td><td>左到右</td></tr><tr><td><strong>13</strong></td><td><code>?:</code></td><td>条件运算符</td><td>右到左</td></tr><tr><td><strong>14</strong></td><td><code>=</code></td><td>赋值运算符</td><td>右到左</td></tr><tr><td></td><td><code>/=</code></td><td>除后赋值</td><td></td></tr><tr><td></td><td><code>*=</code></td><td>乘后赋值</td><td></td></tr><tr><td></td><td><code>%=</code></td><td>取模后赋值</td><td></td></tr><tr><td></td><td><code>+=</code></td><td>加后赋值</td><td></td></tr><tr><td></td><td><code>-=</code></td><td>减后赋值</td><td></td></tr><tr><td></td><td><code><<=</code></td><td>左移后赋值</td><td></td></tr><tr><td></td><td><code>>>=</code></td><td>右移后赋值</td><td></td></tr><tr><td></td><td><code>&=</code></td><td>按位与后赋值</td><td></td></tr><tr><td></td><td><code>^=</code></td><td>按位异或后赋值</td><td></td></tr><tr><td></td><td><code>|=</code></td><td>按位或后赋值</td><td></td></tr><tr><td><strong>15</strong></td><td><code>,</code></td><td>逗号运算符</td><td>左到右</td></tr></tbody></table><div class="warning custom-block github-alert"><p class="custom-block-title">WARNING</p><p></p><ul><li>① 不要过多的依赖运算符的优先级来控制表达式的执行顺序,这样可读性太差,尽量<code>使用小括号来控制</code>表达式的执行顺序。</li><li>② 不要把一个表达式写得过于复杂,如果一个表达式过于复杂,则把它<code>分成几步</code>来完成。</li><li>③ 运算符优先级不用刻意地去记忆,总体上:一元运算符 > 算术运算符 > 关系运算符 > 逻辑运算符 > 三元运算符 > 赋值运算符。</li></ul></div><h1 id="第三章-附录" tabindex="-1">第三章:附录 <a class="header-anchor" href="#第三章-附录" aria-label="Permalink to "第三章:附录""></a></h1><h2 id="_3-1-字符集和字符集编码" tabindex="-1">3.1 字符集和字符集编码 <a class="header-anchor" href="#_3-1-字符集和字符集编码" aria-label="Permalink to "3.1 字符集和字符集编码""></a></h2><h3 id="_3-3-1-概述" tabindex="-1">3.3.1 概述 <a class="header-anchor" href="#_3-3-1-概述" aria-label="Permalink to "3.3.1 概述""></a></h3><ul><li>字符集和字符集编码(简称编码)计算机系统中处理文本数据的两个基本概念,它们密切相关但又有区别。</li><li>字符集(Character Set)是一组字符的集合,其中每个字符都被分配了一个<code>唯一的编号</code>(通常是数字)。字符可以是字母、数字、符号、控制代码(如换行符)等。<code>字符集定义了可以表示的字符的范围</code>,但它并不直接定义如何将这些字符存储在计算机中。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>ASCII(美国信息交换标准代码)是最早期和最简单的字符集之一,它只包括了英文字母、数字和一些特殊字符,共 128 个字符。每个字符都分配给了一个从 0 到 127 的数字。</p></div><ul><li>字符集编码(Character Encoding,简称编码)是一种方案或方法,<code>它定义了如何将字符集中的字符转换为计算机存储和传输的数据(通常是一串二进制数字)</code>。简而言之,编码是字符到二进制数据之间的映射规则。</li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>ASCII编码方案定义了如何将 ASCII 字符集中的每个字符表示为 7 位的二进制数字。例如:大写字母<code>"A"</code>在ASCII 编码中表示为二进制的<code>1000001</code>,十进制的 <code>65</code> 。</p></div><ul><li><code>字符集</code>和<code>字符集编码</code>之间的关系如下:</li></ul><p><img src="/c/assets/29.CGTVELeO.png" alt=""></p><ul><li>Linux 中安装帮助手册:</li></ul><p><img src="/c/assets/30.Bz4_lEH0.gif" alt=""></p><h3 id="_3-3-2-ascii-编码" tabindex="-1">3.3.2 ASCII 编码 <a class="header-anchor" href="#_3-3-2-ascii-编码" aria-label="Permalink to "3.3.2 ASCII 编码""></a></h3><ul><li>从<code>冯·诺依曼</code>体系结构中,我们知道,计算机中所有的<code>数据</code>和<code>指令</code>都是以<code>二进制</code>的形式表示的;所以,计算机中对于文本数据的数据也是以二进制来存储的,那么对应的流程如下:</li></ul><p><img src="/c/assets/31.CcDWE4nn.png" alt=""></p><ul><li>我们知道,计算机是上个世纪 60 年代在美国研制成功的,为了实现字符和二进制的转换,美国就制定了一套字符编码,即英语字符和二进制位之间的关系,即 ASCII (American Standard Code for Information Interchange)编码: <ul><li>ASCII 编码只包括了英文字符、数字和一些特殊字符,一共 128 个字符,并且每个字符都分配了唯一的数字,范围是 0 - 127。</li><li>ASCII 编码中的每个字符都使用 7 位的二进制数字表示;但是,计算机中的存储的最小单位是 1 B = 8 位,那么最高位统一规定为 0 。</li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 其实,早期是没有字符集的概念的,只是后来为了解决乱码问题,而产生了字符集的概念。</li><li>② 对于英文体系来说,<code>a-zA-Z0-9</code>以及一些<code>特殊字符</code>一共 <code>128</code> 就可以满足实际存储需求;所以,在也是为什么 ASCII 码使用 7 位二进制(2^7 = 128 )来存储的。</li></ul></div><ul><li>在操作系统中,就内置了对应的编码表,Linux 也不例外;可以使用如下的命令查看:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">man</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ascii</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/c/assets/32.B7y2_JVX.gif" alt=""></p><ul><li>其对应的 ASCII 编码表,如下所示:</li></ul><p><img src="/c/assets/33.Btcc3rs2.gif" alt=""></p><ul><li>但是,随着计算机的发展,计算机开始了东征之路,由美国传播到东方:</li></ul><p><img src="/c/assets/34.CR4ARW8y.png" alt=""></p><ul><li>先是传播到了欧洲,欧洲在兼容 ASCII 编码的基础上,推出了 ISO8859-1 编码,即: <ul><li>ISO8859-1 编码包括基本的拉丁字母表、数字、标点符号,以及西欧语言中特有的一些字符,如:法语中的 <code>è</code>、德语中的 <code>ü</code> 等。</li><li>ISO 8859-1 为每个字符分配一个单字节(8 位)编码,意味着它可以表示最多 256 (2^8)个不同的字符(编号从 0 到 255)。</li><li>ISO 8859-1 的前 128 个字符与 ASCII 编码完全一致,这使得 ASCII 编码的文本可以无缝转换为 ISO 8859-1 编码。</li></ul></li></ul><p><img src="/c/assets/33.Btcc3rs2.gif" alt=""></p><p><img src="/c/assets/36.DOX3ymYP.gif" alt=""></p><ul><li>计算机继续传播到了亚洲,亚洲(双字节)各个国家分别给出了自己国家对应的字符集编码,如: <ul><li>日本推出了 Shift-JIS 编码: <ul><li>单字节 ASCII 范围:0 - 127。</li><li>双字节范围: <ul><li>第一个字节:129 - 159 和 224 - 239 。</li><li>第二个字节:64 - 126 和 128 - 252 。</li></ul></li></ul></li><li>韩国推出了 EUC-KR 编码: <ul><li>单字节 ASCII 范围:0 - 127。</li><li>双字节范围:从 41281 - 65278。</li></ul></li><li>中国推出了 GBK 编码: <ul><li>单字节 ASCII 范围:0 - 127。</li><li>双字节范围:33088 - 65278 。</li></ul></li></ul></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>① 通过上面日本、韩国、中国的编码十进制范围,我们可以看到,虽然这些编码系统在技术上的编码范围存在重叠(特别是在高位字节区域),但因为它们各自支持的字符集完全不同,所以实际上它们并不直接冲突。</li><li>② 但是,如果一个中国人通过 GBK 编码写的文章,通过邮件发送给韩国人,因为韩国和中国在字符集编码上的高位字节有重叠部分,必然会造成歧义。</li></ul></div><h3 id="_3-3-3-unicode-编码" tabindex="-1">3.3.3 Unicode 编码 <a class="header-anchor" href="#_3-3-3-unicode-编码" aria-label="Permalink to "3.3.3 Unicode 编码""></a></h3><ul><li><p>在 Unicode 之前,世界上存在着数百种不同的编码系统,每一种编码系统都是为了支持特定语言或一组语言的字符集。这些编码系统,包括:ASCII、ISO 8859 系列、GBK、Shift-JIS、EUC-KR 等,它们各自有不同的字符范围和编码方式。这种多样性虽然在局部范围内解决了字符表示的问题,但也带来了以下几个方面的挑战:</p><ul><li><code>编码冲突</code>:由于不同的编码系统可以为相同的字节值分配不同的字符,因此在不同编码之间转换文本时,如果没有正确处理编码信息,就很容易产生乱码。这种编码冲突在尝试处理多种语言的文本时尤为突出。</li><li><code>编码的复杂性</code>:随着全球化的发展,软件和系统需要支持越来越多的语言,这就要求开发者和系统同时处理多种不同的编码系统。这不仅增加了开发和维护的复杂性,而且也增加了出错的风险。</li><li><code>资源限制</code>:在早期计算机技术中,内存和存储资源相对有限。不同的编码标准要求系统存储多套字符集数据,这无疑增加了对有限资源的消耗。</li><li>……</li></ul></li><li><p>针对上述的种种问题,为了推行全球化,Unicode 应运而生,Unicode 的核心规则和设计原则是建立一个全球统一的字符集,使得世界上所有的文字和符号都能被唯一地识别和使用,无论使用者位于何地或使用何种语言。这套规则包括了字符的编码、表示、处理和转换机制,旨在确保不同系统和软件间能够无缝交换和处理文本数据。</p><ul><li><code>通用字符集 (UCS)</code>:Unicode 为每一个字符分配一个唯一的编号(称为<code>“码点”</code>)。这些码点被组织在一个统一的字符集中,官方称之为 “通用字符集”(Universal Character Set,UCS)。码点通常表示为 <code>U+</code> 后跟一个十六进制数,例如:<code>U+0041</code> 代表大写的英文字母 <code>“A”</code>。</li><li><code>编码平面和区段</code>:Unicode 码点被划分为多个 “平面(Planes)”,每个平面包含 65536(16^4)个码点。目前,Unicode定义了 17 个平面(从 0 到16),每个平面被分配了一个编号,从 “基本多文种平面(BMP)” 的 0 开始,到 16 号平面结束。这意味着 Unicode 理论上可以支持超过 110万(17*65536)个码点。</li></ul></li><li><p>Unicode 仅仅只是字符集,给每个字符设置了唯一的数字编号而已,却没有给出这些数字编号实际如何存储,可以通过如下命令查看:</p></li></ul><p><img src="/c/assets/37.Cie9_tkP.gif" alt=""></p><ul><li>为了在计算机系统中表示 Unicode 字符,定义了几种编码方案,这些方案包括 UTF-8、UTF-16 和 UTF-32 等。 <ul><li><strong>UTF-8</strong>:使用 1 - 4 个字节表示每个 Unicode 字符,兼容 ASCII,是网络上最常用的编码。</li><li><strong>UTF-16</strong>:使用 2 - 4 个字节表示每个 Unicode 字符,适合于需要经常处理基本多文种平面之外字符的应用。</li><li><strong>UTF-32</strong>:使用固定的 4 个字节表示每个 Unicode 字符,简化了字符处理,但增加了存储空间的需求。</li></ul></li><li><code>Unicode 字符集</code>和对应的<code>UTF-8 字符编码</code>之间的关系,如下所示:</li></ul><p><img src="/c/assets/38.DLjH9Ges.png" alt=""></p></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-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-23T01:22:47.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/02_xdx/" data-v-d4a0bba5><!--[--><span class="desc" data-v-d4a0bba5>上一篇</span><span class="title" data-v-d4a0bba5>变量和进制</span><!--]--></a></div><div class="pager" data-v-d4a0bba5><a class="VPLink link pager-link next" href="/c/notes/01_c-basic/04_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("{\"index.md\":\"uFk6fSzW\",\"notes_index.md\":\"3bIiHjBr\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cxyt4HEd\",\"notes_01_c-basic_04_xdx_index.md\":\"CJSxDj__\",\"notes_01_c-basic_03_xdx_index.md\":\"CgLUd3rz\"}");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\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"uFk6fSzW\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cxyt4HEd\",\"notes_index.md\":\"3bIiHjBr\",\"notes_01_c-basic_04_xdx_index.md\":\"CJSxDj__\",\"notes_01_c-basic_03_xdx_index.md\":\"No5lEq6U\"}");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\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -8,10 +8,10 @@
|
|||||||
<meta name="generator" content="VitePress v1.2.3">
|
<meta name="generator" content="VitePress v1.2.3">
|
||||||
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
|
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
|
||||||
|
|
||||||
<script type="module" src="/c/assets/app.DrgBDoBl.js"></script>
|
<script type="module" src="/c/assets/app.DN8pJb91.js"></script>
|
||||||
<link rel="preload" href="/c/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
|
<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/framework.BE8if9e6.js">
|
||||||
<link rel="modulepreload" href="/c/assets/chunks/theme.DeJoNarU.js">
|
<link rel="modulepreload" href="/c/assets/chunks/theme.CbwtpqME.js">
|
||||||
<link rel="modulepreload" href="/c/assets/notes_01_c-basic_04_xdx_index.md.CJSxDj__.lean.js">
|
<link rel="modulepreload" href="/c/assets/notes_01_c-basic_04_xdx_index.md.CJSxDj__.lean.js">
|
||||||
<link rel="shortcut icon" href="/c//logo.svg">
|
<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="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,shrink-to-fit=no">
|
||||||
@ -717,7 +717,7 @@
|
|||||||
<span class="line"></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:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
||||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br></div></div></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-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-22T23:40:01.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/03_xdx/" data-v-d4a0bba5><!--[--><span class="desc" data-v-d4a0bba5>上一篇</span><span class="title" data-v-d4a0bba5>数据类型和运算符</span><!--]--></a></div><div class="pager" data-v-d4a0bba5><a class="VPLink link pager-link next" href="/c/notes/01_c-basic/05_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>
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br></div></div></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-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-22T23:40:01.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/03_xdx/" data-v-d4a0bba5><!--[--><span class="desc" data-v-d4a0bba5>上一篇</span><span class="title" data-v-d4a0bba5>数据类型和运算符</span><!--]--></a></div><div class="pager" data-v-d4a0bba5><a class="VPLink link pager-link next" href="/c/notes/01_c-basic/05_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("{\"index.md\":\"uFk6fSzW\",\"notes_index.md\":\"3bIiHjBr\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cxyt4HEd\",\"notes_01_c-basic_04_xdx_index.md\":\"CJSxDj__\",\"notes_01_c-basic_03_xdx_index.md\":\"CgLUd3rz\"}");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\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"uFk6fSzW\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cxyt4HEd\",\"notes_index.md\":\"3bIiHjBr\",\"notes_01_c-basic_04_xdx_index.md\":\"CJSxDj__\",\"notes_01_c-basic_03_xdx_index.md\":\"No5lEq6U\"}");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\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -8,10 +8,10 @@
|
|||||||
<meta name="generator" content="VitePress v1.2.3">
|
<meta name="generator" content="VitePress v1.2.3">
|
||||||
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
|
<link rel="preload stylesheet" href="/c/assets/style.bTUc_nQv.css" as="style">
|
||||||
|
|
||||||
<script type="module" src="/c/assets/app.DrgBDoBl.js"></script>
|
<script type="module" src="/c/assets/app.DN8pJb91.js"></script>
|
||||||
<link rel="preload" href="/c/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
|
<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/framework.BE8if9e6.js">
|
||||||
<link rel="modulepreload" href="/c/assets/chunks/theme.DeJoNarU.js">
|
<link rel="modulepreload" href="/c/assets/chunks/theme.CbwtpqME.js">
|
||||||
<link rel="modulepreload" href="/c/assets/notes_index.md.3bIiHjBr.lean.js">
|
<link rel="modulepreload" href="/c/assets/notes_index.md.3bIiHjBr.lean.js">
|
||||||
<link rel="shortcut icon" href="/c//logo.svg">
|
<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="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>
|
</head>
|
||||||
<body>
|
<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 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/03_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>数据类型和运算符</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/04_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>流程控制</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/05_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>数组</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/06_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>函数</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/07_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>指针</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/08_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>预处理器</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/09_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>自定义数据类型</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/10_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>字符串和时间</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/11_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>内存管理</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/12_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>文件操作</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="group" data-v-575e6a36><div 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><p class="text" data-v-b8d55f3b>C 语言高级</p><!----></div><!----></div></div><div class="group" data-v-575e6a36><div 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><p class="text" data-v-b8d55f3b>C++ 核心编程</p><!----></div><!----></div></div><div class="group" data-v-575e6a36><div 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><p class="text" data-v-b8d55f3b>C++ 标准库</p><!----></div><!----></div></div><div class="group" data-v-575e6a36><div 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><p class="text" data-v-b8d55f3b>QT 桌面开发</p><!----></div><!----></div></div><div class="group" data-v-575e6a36><div 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><p class="text" data-v-b8d55f3b>Linux 高并发服务器开发</p><!----></div><!----></div></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-5d98c3a5 data-v-1428d186><div class="VPDoc has-sidebar has-aside" data-v-1428d186 data-v-39a288b8><!--[--><!--]--><div class="container" data-v-39a288b8><div class="aside" data-v-39a288b8><div class="aside-curtain" data-v-39a288b8></div><div class="aside-container" data-v-39a288b8><div class="aside-content" data-v-39a288b8><div class="VPDocAside" data-v-39a288b8 data-v-3f215769><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-3f215769 data-v-a5bbad30><div class="content" data-v-a5bbad30><div class="outline-marker" data-v-a5bbad30></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-a5bbad30>目录</div><ul class="VPDocOutlineItem root" data-v-a5bbad30 data-v-b933a997><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-3f215769></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-39a288b8><div class="content-container" data-v-39a288b8><!--[--><!--]--><main class="main" data-v-39a288b8><div style="position:relative;" class="vp-doc _c_notes_" data-v-39a288b8><div><h1 id="c-c-学科" tabindex="-1">c/c++ 学科 <a class="header-anchor" href="#c-c-学科" aria-label="Permalink to "c/c++ 学科""></a></h1><hr><iframe src="https://roadmap.sh/r/embed?id=6695c8262b17b182cbf4b520" width="115%" height="500px" frameBorder="0"></iframe></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-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-16T01:10:27.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>
|
<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 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/03_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>数据类型和运算符</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/04_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>流程控制</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/05_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>数组</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/06_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>函数</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/07_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>指针</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/08_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>预处理器</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/09_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>自定义数据类型</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/10_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>字符串和时间</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/11_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>内存管理</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/12_xdx/" data-v-b8d55f3b><!--[--><p class="text" data-v-b8d55f3b>文件操作</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="group" data-v-575e6a36><div 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><p class="text" data-v-b8d55f3b>C 语言高级</p><!----></div><!----></div></div><div class="group" data-v-575e6a36><div 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><p class="text" data-v-b8d55f3b>C++ 核心编程</p><!----></div><!----></div></div><div class="group" data-v-575e6a36><div 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><p class="text" data-v-b8d55f3b>C++ 标准库</p><!----></div><!----></div></div><div class="group" data-v-575e6a36><div 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><p class="text" data-v-b8d55f3b>QT 桌面开发</p><!----></div><!----></div></div><div class="group" data-v-575e6a36><div 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><p class="text" data-v-b8d55f3b>Linux 高并发服务器开发</p><!----></div><!----></div></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-5d98c3a5 data-v-1428d186><div class="VPDoc has-sidebar has-aside" data-v-1428d186 data-v-39a288b8><!--[--><!--]--><div class="container" data-v-39a288b8><div class="aside" data-v-39a288b8><div class="aside-curtain" data-v-39a288b8></div><div class="aside-container" data-v-39a288b8><div class="aside-content" data-v-39a288b8><div class="VPDocAside" data-v-39a288b8 data-v-3f215769><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-3f215769 data-v-a5bbad30><div class="content" data-v-a5bbad30><div class="outline-marker" data-v-a5bbad30></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-a5bbad30>目录</div><ul class="VPDocOutlineItem root" data-v-a5bbad30 data-v-b933a997><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-3f215769></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-39a288b8><div class="content-container" data-v-39a288b8><!--[--><!--]--><main class="main" data-v-39a288b8><div style="position:relative;" class="vp-doc _c_notes_" data-v-39a288b8><div><h1 id="c-c-学科" tabindex="-1">c/c++ 学科 <a class="header-anchor" href="#c-c-学科" aria-label="Permalink to "c/c++ 学科""></a></h1><hr><iframe src="https://roadmap.sh/r/embed?id=6695c8262b17b182cbf4b520" width="115%" height="500px" frameBorder="0"></iframe></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-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-16T01:10:27.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("{\"index.md\":\"uFk6fSzW\",\"notes_index.md\":\"3bIiHjBr\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cxyt4HEd\",\"notes_01_c-basic_04_xdx_index.md\":\"CJSxDj__\",\"notes_01_c-basic_03_xdx_index.md\":\"CgLUd3rz\"}");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\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
<script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"uFk6fSzW\",\"notes_01_c-basic_01_xdx_index.md\":\"DA3nuW_4\",\"notes_01_c-basic_02_xdx_index.md\":\"Cxyt4HEd\",\"notes_index.md\":\"3bIiHjBr\",\"notes_01_c-basic_04_xdx_index.md\":\"CJSxDj__\",\"notes_01_c-basic_03_xdx_index.md\":\"No5lEq6U\"}");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\":\"数据类型和运算符\",\"link\":\"/notes/01_c-basic/03_xdx/\"},{\"text\":\"流程控制\",\"link\":\"/notes/01_c-basic/04_xdx/\"},{\"text\":\"数组\",\"link\":\"/notes/01_c-basic/05_xdx/\"},{\"text\":\"函数\",\"link\":\"/notes/01_c-basic/06_xdx/\"},{\"text\":\"指针\",\"link\":\"/notes/01_c-basic/07_xdx/\"},{\"text\":\"预处理器\",\"link\":\"/notes/01_c-basic/08_xdx/\"},{\"text\":\"自定义数据类型\",\"link\":\"/notes/01_c-basic/09_xdx/\"},{\"text\":\"字符串和时间\",\"link\":\"/notes/01_c-basic/10_xdx/\"},{\"text\":\"内存管理\",\"link\":\"/notes/01_c-basic/11_xdx/\"},{\"text\":\"文件操作\",\"link\":\"/notes/01_c-basic/12_xdx/\"}]},{\"text\":\"C 语言高级\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 核心编程\",\"collapsed\":true,\"items\":[]},{\"text\":\"C++ 标准库\",\"collapsed\":true,\"items\":[]},{\"text\":\"QT 桌面开发\",\"collapsed\":true,\"items\":[]},{\"text\":\"Linux 高并发服务器开发\",\"collapsed\":true,\"items\":[]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/Aurorxa\"}],\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2024 许大仙\"},\"outline\":{\"level\":[1,6],\"label\":\"目录\"},\"outlineTitle\":\"当前页大纲\"},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue
Block a user