c/assets/notes_01_c-basic_01_xdx_index.md.82DJjZSe.js

330 lines
208 KiB
JavaScript
Raw Normal View History

import{_ as s,c as a,o as i,a6 as n}from"./chunks/framework.CZKtKhAm.js";const l="/c/assets/1.D4a42fT1.jpg",e="/c/assets/2.D2wnxl5F.png",p="/c/assets/3.Dq625oo9.jpg",t="/c/assets/4.uqu1DEK4.png",r="/c/assets/5.C6Q0Q8kf.jpg",h="/c/assets/6.B4Srsb-0.png",c="/c/assets/7._D_c8Lrn.png",d="/c/assets/8.DlIyFGDg.png",o="/c/assets/9.7zkUmpQw.png",k="/c/assets/10.h1ugtjyX.png",u="/c/assets/11.D5PWTabw.png",g="/c/assets/12.Bvs6QYjl.jpg",b="/c/assets/9.7zkUmpQw.png",m="/c/assets/14.CsR5exrN.png",E="/c/assets/15.BRG9GQdT.png",C="/c/assets/16.C2sciGZn.png",y="/c/assets/17.DdyXXyxJ.png",F="/c/assets/18.DIeb_KXW.png",_="/c/assets/19.C-kvMz2p.png",v="/c/assets/20.CQqFxmDa.png",B="/c/assets/21.CjMWyIiX.png",A="/c/assets/22.DFQhcDgs.png",f="/c/assets/23.Cco1vsW8.png",x="/c/assets/24.D60Zf6_d.png",D="/c/assets/25.D2-G6nV2.png",q="/c/assets/26.DpzkVk5V.png",S="/c/assets/27.BXk95GIP.png",w="/c/assets/28.CbWTB08W.png",L="/c/assets/29.twO9TCIg.png",P="/c/assets/30.CKOjeIvS.png",T="/c/assets/31.DKmR0CxE.png",U="/c/assets/32.Cudf77_s.gif",I="/c/assets/33.BBUUlhRC.png",W="/c/assets/34.iLABkB7O.png",O="/c/assets/35.BQuYWOU9.png",N="/c/assets/36.CslpH6j0.png",R="/c/assets/37.BAyvZdKq.png",M="/c/assets/38.C3oC1iUd.png",X="/c/assets/39.Ds-jsEZn.png",G="/c/assets/40.Cd37gMYs.png",V="/c/assets/41.CAw2z3gc.png",$="/c/assets/42.DdPThnr-.png",H="/c/assets/43.q_rvlDnY.png",K="/c/assets/44.JRHg9RZA.png",j="/c/assets/45.Baq-Hb06.png",Q="/c/assets/46.c1ht53mu.png",J="/c/assets/47.CAZmH5Py.png",Y="/c/assets/48.DWeCYBe9.png",z="/c/assets/49.2XM8pYni.png",Z="/c/assets/50.CN0t-fuo.png",ss="/c/assets/51.AcDh3LXQ.png",as="/c/assets/52.CUkDFAc6.png",is="/c/assets/53.picNTNaJ.png",ns="/c/assets/54.DKX92RgJ.png",ls="/c/assets/55.Bxr7QKI3.png",es="/c/assets/56.DuFWsOgW.png",ps="/c/assets/57.Da9qUcfr.png",ts="/c/assets/58.7_gEABSX.gif",rs="/c/assets/59.C2KQYoVC.gif",hs="/c/assets/60.RTUP8Vtx.png",cs="/c/assets/61.Dq21DxwL.png",ds="/c/assets/62.QmpUaNxU.png",os="/c/assets/63.DP0C29gZ.png",ks="/c/assets/64.DwzHokd4.png",us="/c/assets/65.Bi6K26yA.png",gs="/c/assets/66.Bw8DcEQ_.png",bs="/c/assets/67.DPc8Z9rS.png",ms="/c/assets/68.S84xHMTl.png",Es="/c/assets/69.iw3JQUkn.png",Cs="/c/assets/70.ILeJt-HK.png",ys="/c/assets/71.CHgm7khh.png",Fs="/c/assets/72.N1nqJaEg.png",_s="/c/assets/73.DHsnibMi.png",vs="/c/assets/74.BQr6Q0uV.png",Bs="/c/assets/75.BVemi2Lh.png",As="/c/assets/76.BHR69UXx.png",fs="/c/assets/77.CPSU5SJI.png",xs="/c/assets/78.CaQLoDlw.png",Ds="/c/assets/79.aRGy4XbL.png",qs="/c/assets/80.kNO9fmPR.png",Ss="/c/assets/81.D4EkoC4o.png",ws="/c/assets/82.V23Lo9e_.png",Ls="/c/assets/83.Du9LVeMB.png",Ps="/c/assets/84.DdFg75U9.png",Ts="/c/assets/85.C6bz6KtT.png",Us="/c/assets/86.CB6LAhB5.png",Is="/c/assets/87.Bip8bkua.png",Ws="/c/assets/88.DRNHRduW.png",Os="/c/assets/89.Cth4qqEn.png",Ns="/c/assets/90.DWGWZ64P.png",Rs="/c/assets/91.3hDIDdvx.png",Ms="/c/assets/92.Bw_dQ4ap.png",Xs="/c/assets/93.Cn_ubTyA.png",Gs="/c/assets/94.C84EBqwB.png",Vs="/c/assets/95.dZfJY4eR.png",$s="/c/assets/96.B0zm0Z79.png",Hs="/c/assets/97.CaTcEy1Q.png",Ks="/c/assets/98.iEc8mo9g.png",js="/c/assets/99.Co2KxM6t.png",Qs="/c/assets/100.CaUm8Qhc.png",Js="/c/assets/101.kOkqIKG6.png",Ys="/c/assets/102.CyeASH-c.png",zs="/c/assets/103.CFdk60La.png",Zs="/c/assets/104.Bhl-0uK_.png",sa="/c/assets/105.Dni9KbXV.png",aa="/c/assets/106.BXx10MCV.png",ia="/c/assets/107.CXcIKX1T.png",na="/c/assets/108.CQ3_QCQT.png",la="/c/assets/109.CQoDRJM5.gif",ea="/c/assets/110.CPfwZvD9.gif",pa="/c/assets/111.bxEomEjU.gif",ta="/c/assets/112.C_onhf2k.png",ra="/c/assets/113.Budj3s38.gif",ha="/c/assets/114.CH8koQdu.gif",ca="/c/assets/115.kUJhxMtg.png",da="/c/assets/116.BJeJJW4_.png",oa="/c/assets/117.BCuK6eJL.gif",ka="/c/assets/118.rKC-z4z-.gif",ua="/c/assets/119.BJE3xxuT.gif",ga="/c/assets/120.DJOq__O0.gif",ba="/c/assets/121.BDt_0fRR.png",ma="/c/assets/122.Bo5OawW8.png",Ea="/c/assets/123.sUWUfl5e.png",Ca="/c/assets/124.BK4jpnB8.png",ya="/c/assets/125.EF8vdbSq.png",Fa="/c/assets/126.DjxdA_Co.png",_a="/c/assets/127.sp68q1hh.gif",va="/c/assets/128.DhMRyxNN.gif",Ba="/c/assets/129.CdcLZM0R.gif",Aa="/c/assets/130.D-5AsTTr.png",fa="/c/assets/1
<span class="line"><span>1 毫秒 = 1000 微妙 1 ms = 1000 us </span></span>
<span class="line"><span>1 微妙 = 1000 纳秒 1 us = 1000 ns</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><ul><li></li></ul><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span> CPU 1 </span></span>
<span class="line"><span>那么内存访问就需要 6 分钟</span></span>
<span class="line"><span>那么固态硬盘就需要 2-6 </span></span>
<span class="line"><span>那么传统硬盘就需要 1-12 个月</span></span>
<span class="line"><span>那么网络访问就需要 4 年以上</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><ul><li> CPU </li><li><code></code>寿</li></ul><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>寿</span></span>
<span class="line"><span> --- 出自 西汉淮南王刘安淮南子</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span> </span></span>
<span class="line"><span>挟飞仙以遨游抱明月而长终 知不可乎骤得托遗响于悲风</span></span>
<span class="line"><span> --- 出自 苏轼赤壁赋</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p><code></code><code></code></p></div><ul><li>CPU L1L2 L3</li></ul><p><img src="`+c+'" alt="img"></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p></p><ul><li> 便</li><li> /</li></ul></div><h2 id="_1-4-" tabindex="-1">1.4 <a class="header-anchor" href="#_1-4-" aria-label="Permalink to &quot;1.4 &quot;"></a></h2><h3 id="_1-4-1-" tabindex="-1">1.4.1 <a class="header-anchor" href="#_1-4-1-" aria-label="Permalink to &quot;1.4.1 &quot;"></a></h3><ul><li></li></ul><p><img src="'+d+'" alt=""></p><ul><li></li></ul><p><img src="'+o+'" alt=""></p><ul><li> <ul><li></li><li></li><li></li><li></li><li></li><li></li></ul></li></ul><ul><li> <ul><li></li><li>使 <ul><li><code></code><code></code></li><li><code></code><code></code><code></code></li><li><code></code>GUI使<code></code></li></ul></li></ul></li></ul><p><img src="'+k+'" alt=""></p><h3 id="_1-4-2-" tabindex="-1">1.4.2 <EFBFBD>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> java.nio.file.Files;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> java.nio.file.Path;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> java.nio.file.Paths;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> java.util.List;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Demo</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> static</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> writeFile</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(String </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">filePath</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, String </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">content</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> Path path </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> Paths.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(filePath);</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> try</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> Files.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">write</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(path, content.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">getBytes</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">());</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">catch</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (IOException </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">e</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> e.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">printStackTrace</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">();</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> static</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">String</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[] </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">args</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:#24292E;--shiki-dark:#E1E4E8;"> a </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>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> b </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 20</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">; </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// </span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> c </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> a </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> b; </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// </span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> string filePath </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;c:/demo.txt&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">; </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// </span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> string txt </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> a </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> b </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> c; </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// </span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> writeFile</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(filePath, a); </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// </span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> System.out.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">println</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(a); </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// </span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> System.out.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">println</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(b); </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// </span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> System.out.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">println</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(c); </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// </span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br></div></div><h3 id="_1-4-3-isaabi--api" tabindex="-1">1.4.3 ISAABI API <a class="header-anchor" href="#_1-4-3-isaabi--api" aria-label="Permalink to &quot;1.4.3 ISAABI API&quot;"></a></h3><ul><li>ISA ABI API </li></ul><p><img src="`+g+'" alt=""></p><ul><li> ISA ISA OS System ISA User ISA </li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li> ISA ISA 使访 ISAx86ARMMIPS </li><li> ISA 便 ARM ARM ISA </li></ul></div><ul><li> ABI <code></code><code></code><code></code>ABI ABI </li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li> ABI ABI </li><li> windows <code>PE</code>portable executable<code>.dll</code> dynamic link library <code>.lib</code> Linux <code>ELF</code>executable and linking format<code>.so</code> shared object <code>.a</code> </li><li> Linux <code>file /bin/ls</code> ABI Windows Linux </li><li> Linux <EFBFBD><EFBFBD>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // </span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // </span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 0</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></div></div><ul><li></li><li> CPU <code></code><code></code></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p></p></div><ul><li> Java Java Java </li><li> Python Python Python </li><li></li><li> <ul><li> <code></code></li><li> <code></code></li></ul></li></ul><h2 id="_2-3-" tabindex="-1">2.3 <a class="header-anchor" href="#_2-3-" aria-label="Permalink to &quot;2.3 &quot;"></a></h2><h3 id="_2-3-1--" tabindex="-1">2.3.1 <a class="header-anchor" href="#_2-3-1--" aria-label="Permalink to &quot;2.3.1 &quot;"></a></h3><ul><li>1946 2 14 <code>ENIAC</code> 使<code>穿</code></li></ul><p><img src="`+C+`" alt=""></p><ul><li>使<code></code><code></code></li></ul><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>0000,0000,000000010000 LOAD A, 16</span></span>
<span class="line"><span>0000,0001,000000000001 代表 LOAD B, 1</span></span>
<span class="line"><span>0001,0001,000000010000 代表 STORE B, 16</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><ul><li><code></code> 99.9% </li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>CPU x86_64arm ISA</p></div><h3 id="_2-3-2---" tabindex="-1">2.3.2 &amp; <a class="header-anchor" href="#_2-3-2---" aria-label="Permalink to &quot;2.3.2 &amp;&quot;"></a></h3><ul><li><code></code>使<code></code>MOVADDSUB使<code></code><code></code></li></ul><p><img src="`+y+'" alt=""></p><ul><li><code></code><code></code><code></code><code></code></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p></p></div><h3 id="_2-3-3--" tabindex="-1">2.3.3 <a class="header-anchor" href="#_2-3-3--" aria-label="Permalink to &quot;2.3.3 &quot;"></a></h3><ul><li><code></code><code>使</code><code>使</code><code>使</code></li></ul><p><img src="'+F+'" alt=""></p><ul><li><code></code>使<code></code><code></code></li></ul><p><img src="'+_+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>使CC++JavaPythonC#JavaScriptGoSQL </p></div><h3 id="_2-3-4-" tabindex="-1">2.3.4 <a class="header-anchor" href="#_2-3-4-" aria-label="Permalink to &quot;2.3.4 &quot;"></a></h3><ul><li></li></ul><table tabindex="0"><thead><tr><th style="text-align:left;"></th><th style="text-align:left;"></th><th style="text-align:left;"></th><th style="text-align:left;"></th><th style="text-align:left;"></th></tr></thead><tbody><tr><td style="text-align:left;"><strong></strong></td><td style="text-align:left;"></td><td style="text-align:left;"></td><td style="text-align:left;"></td><td style="text-align:left;"></td></tr><tr><td style="text-align:left;"><strong></strong></td><td style="text-align:left;"><EFBFBD><EFBFBD>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(){</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Hello World&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><p><img src="`+la+'" alt=""></p><ul><li> <code>gcc</code> </li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.exe</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+ea+'" alt=""></p><ul><li> </li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./HelloWorld.exe</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+pa+'" alt=""></p><h3 id="_4-3-2-vs-code-" tabindex="-1">4.3.2 VS Code <a class="header-anchor" href="#_4-3-2-vs-code-" aria-label="Permalink to &quot;4.3.2 VS Code &quot;"></a></h3><ul><li> <code></code></li></ul><p><img src="'+ta+'" alt=""></p><ul><li> <code>vscode</code> </li></ul><p><img src="'+ra+'" alt=""></p><ul><li> <code>vscode</code> <code>HelloWorld.c</code> </li></ul><p><img src="'+ha+'" alt=""></p><ul><li> VSCode C/C++ </li></ul><p><img src="'+ca+'" alt=""></p><p><img src="'+da+`" alt=""></p><ul><li> </li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(){</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Hello World&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><p><img src="`+oa+'" alt=""></p><ul><li> <code>gcc</code> </li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> HelloWorld.exe</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+ka+'" alt=""></p><ul><li> </li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./HelloWorld.exe</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+ua+'" alt=""></p><ul><li> Code Runner </li></ul><p><img src="'+ga+'" alt=""></p><h3 id="_4-3-3-vs-" tabindex="-1">4.3.3 VS <a class="header-anchor" href="#_4-3-3-vs-" aria-label="Permalink to &quot;4.3.3 VS &quot;"></a></h3><ul><li> </li></ul><p><img src="'+ba+'" alt=""></p><p><img src="'+ma+'" alt=""></p><p><img src="'+Ea+'" alt=""></p><p><img src="'+Ca+'" alt=""></p><ul><li> <code></code></li></ul><p><img src="'+ya+'" alt=""></p><p><img src="'+Fa+'" alt=""></p><ul><li> <code>HelloWorld.c</code> </li></ul><p><img src="'+_a+`" alt=""></p><ul><li> </li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(){</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Hello World&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><p><img src="`+va+'" alt=""></p><ul><li> </li></ul><p><img src="'+Ba+'" alt=""></p><h3 id="_4-3-4-clion" tabindex="-1">4.3.4 CLion <a class="header-anchor" href="#_4-3-4-clion" aria-label="Permalink to &quot;4.3.4 CLion&quot;"></a></h3><ul><li> </li></ul><p><img src="'+Aa+'" alt=""></p><p><img src="'+fa+'" alt=""></p><p><img src="'+xa+`" alt=""></p><ul><li> </li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(){</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Hello World&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><p><img src="`+Da+'" alt=""></p><ul><li> </li></ul><p><img src="'+qa+'" alt=""></p><ul><li> c main CLion </li></ul><p><img src="'+Sa+'" alt=""></p><ul><li> </li></ul><p><img src="'+wa+'" alt=""></p><p><img src="'+La+`" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p></p><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>-Dfile.encoding=UTF-8</span></span>
<span class="line"><span>-Dconsole.encoding=UTF-8</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div></div><h1 id="-" tabindex="-1"> <a class="header-anchor" href="#-" aria-label="Permalink to &quot;&quot;"></a></h1><h2 id="_5-1-" tabindex="-1">5.1 <a class="header-anchor" href="#_5-1-" aria-label="Permalink to &quot;5.1 &quot;"></a></h2><ul><li><code></code><code></code></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li> </li><li> <code></code><code></code></li></ul></div><h2 id="_5-2-" tabindex="-1">5.2 <a class="header-anchor" href="#_5-2-" aria-label="Permalink to &quot;5.2 &quot;"></a></h2><ul><li>C </li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// </span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> CLion <code>Ctrl + /</code> </p></div><ul><li></li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // </span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // </span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // </span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 0</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></div></div><h2 id="_5-3-" tabindex="-1">5.3 <a class="header-anchor" href="#_5-3-" aria-label="Permalink to &quot;5.3 &quot;"></a></h2><ul><li>C </li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">/*</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  这是第一行注释</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  这是第二行注释</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  这是第三行注释</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">*/</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li> 使</li><li> CLion <code>Ctrl + Alt + /</code> </li></ul></div><ul><li></li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() { </span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /*</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> printf(1);</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> printf(2);</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> */</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">); </span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">; </span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br></div></div><h1 id="-helloworld--" tabindex="-1">HelloWorld <a class="header-anchor" href="#-helloworld--" aria-label="Permalink to &quot;HelloWorld &quot;"></a></h1><h2 id="_6-1-" tabindex="-1">6.1 <a class="header-anchor" href="#_6-1-" aria-label="Permalink to &quot;6.1 &quot;"></a></h2><h3 id="_6-1-1-" tabindex="-1">6.1.1 <a class="header-anchor" href="#_6-1-1-" aria-label="Permalink to &quot;6.1.1 &quot;"></a></h3><ul><li> 使 <code>tab</code> 使 <code>shift + tab</code> </li><li> <code>2 + 4 = 6</code></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> IDE CLion <code>Ctrl + Alt + L</code> </p></div><ul><li></li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> a </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1</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:#24292E;--shiki-dark:#E1E4E8;"> b </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</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:#24292E;--shiki-dark:#E1E4E8;"> c </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> a </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> b;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;c = </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, c);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br></div></div><h3 id="_6-1-2-" tabindex="-1">6.1.2 <a class="header-anchor" href="#_6-1-2-" aria-label="Permalink to &quot;6.1.2 &quot;"></a></h3><ul><li> C <code></code><code></code></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p><code></code></p></div><ul><li></li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">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;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(a </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> b) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> a;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">else</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:#24292E;--shiki-dark:#E1E4E8;"> b;</span></span>
<span class="line"><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></div></div><ul><li></li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{ </span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(a </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> b) </span></span>
<span class="line"><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:#24292E;--shiki-dark:#E1E4E8;"> a;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> } </span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> b;</span></span>
<span class="line"><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></div></div><h2 id="_6-2-" tabindex="-1">6.2 <a class="header-anchor" href="#_6-2-" aria-label="Permalink to &quot;6.2 &quot;"></a></h2><h3 id="_6-2-1-main-" tabindex="-1">6.2.1 main() <a class="header-anchor" href="#_6-2-1-main-" aria-label="Permalink to &quot;6.2.1 main() &quot;"></a></h3><ul><li> C main() main() </li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</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></div></div><ul><li> main() main() </li><li> main() <code>int</code> <code></code> main() main() </li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li> C <code>return 0</code> main() </li><li> main() <code>return 0</code> </li></ul></div><h3 id="_6-2-2-" tabindex="-1">6.2.2 <a class="header-anchor" href="#_6-2-2-" aria-label="Permalink to &quot;6.2.2 &quot;"></a></h3><ul><li> <code>{}</code> </li><li> C </li><li> <code>;</code></li><li> </li></ul><h3 id="_6-2-3-printf-" tabindex="-1">6.2.3 printf() <a class="header-anchor" href="#_6-2-3-printf-" aria-label="Permalink to &quot;6.2.3 printf() &quot;"></a></h3><ul><li>printf() </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:#6F42C1;--shiki-dark:#B392F0;">printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> char</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">__format</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, ...)</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><ul><li>printf() f format</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:#6F42C1;--shiki-dark:#B392F0;">printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Hello World&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span><span 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><ul><li> <code>\\n</code></li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span clas
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 编译器将在系统的标准头文件目录中查找文件。</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;filename&gt;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 编译器首先在当前目录中查找文件,如果未找到,再在标准头文件目录中查找。</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;filename&quot;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><h1 id="-clion--" tabindex="-1">CLion <a class="header-anchor" href="#-clion--" aria-label="Permalink to &quot;CLion &quot;"></a></h1><h2 id="_7-1--wsl2" tabindex="-1">7.1 WSL2 <a class="header-anchor" href="#_7-1--wsl2" aria-label="Permalink to &quot;7.1 WSL2&quot;"></a></h2><h3 id="_7-1-1-" tabindex="-1">7.1.1 <a class="header-anchor" href="#_7-1-1-" aria-label="Permalink to &quot;7.1.1 &quot;"></a></h3><ul><li>WSL 2 Windows Subsystem for Linux 2 Windows Linux WSL 2 WSL Linux WSL 1 使广</li><li></li></ul><p><img src="`+Pa+'" alt=""></p><ul><li><p>WSL2 </p><ul><li> <strong>Linux</strong>WSL 2 使 Linux WSL 2 Linux </li><li> <strong></strong>WSL 2 WSL 1 I/O WSL 2 </li><li> <strong></strong>使 Linux WSL 2 Linux WSL 1 WSL 2</li><li> <strong></strong>WSL 2 Windows </li><li> <strong>使</strong>WSL 2 使</li></ul></li><li><p>WSL </p><ul><li> <strong></strong>WSL 2 Linux Windows Linux </li><li> <strong></strong>使 WSL 2 Windows Linux </li><li> <strong></strong>WSL 2 Windows Linux </li><li> <strong> Linux </strong>WSL 2 Windows Linux Docker</li></ul></li></ul><h3 id="_7-1-2-wsl2-" tabindex="-1">7.1.2 WSL2 <a class="header-anchor" href="#_7-1-2-wsl2-" aria-label="Permalink to &quot;7.1.2 WSL2 &quot;"></a></h3><ul><li> BIOS UEFI </li></ul><p><img src="'+Ta+'" alt=""></p><ul><li> </li></ul><p><img src="'+Ua+'" alt=""></p><ul><li> Linux Windows </li></ul><div class="language-powershell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">powershell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span sty
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dnf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> groupinstall</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Development Tools&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # </span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dnf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> gcc-c++</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # GCC</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dnf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> cmake</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # cmake</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dnf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> make</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # make</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dnf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> gdb</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # gdb</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><p><img src="`+Va+'" alt=""></p><ul><li> CLion </li></ul><p><img src="'+$a+`" alt=""></p><h3 id="_7-1-4--wsl2" tabindex="-1">7.1.4 WSL2 <a class="header-anchor" href="#_7-1-4--wsl2" aria-label="Permalink to &quot;7.1.4 WSL2&quot;"></a></h3><ul><li> Ubuntu 24.04便 cmake </li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> apt</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> update</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> apt</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> upgrade</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # </span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> apt</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> build-essential</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # </span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> apt</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> gcc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> g++</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # GCC </span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> apt</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> cmake</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # cmake</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sudo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> apt</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> gdb</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # gdb</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><p><img src="`+Ha+'" alt=""></p><ul><li> CLion </li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> GDB CLion </p></div><p><img src="'+Ka+'" alt=""></p><h2 id="_7-2--clion--cmake-" tabindex="-1">7.2 CLion cmake <a class="header-anchor" href="#_7-2--clion--cmake-" aria-label="Permalink to &quot;7.2 CLion cmake &quot;"></a></h2><ul><li> CLoin cmake 便 cmake </li></ul><p><img src="'+ja+'" alt=""></p><h2 id="_7-3--cmakelists-txt-" tabindex="-1">7.3 CMakeLists.txt <a class="header-anchor" href="#_7-3--cmakelists-txt-" aria-label="Permalink to &quot;7.3 CMakeLists.txt &quot;"></a></h2><ul><li> C main() <code>CMakeLists.txt</code> 便 C main() </li></ul><p><img src="'+Qa+`" alt=""></p><ul><li><code>CMakeLists.txt</code> </li></ul><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>cmake_minimum_required(VERSION 3.10)</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 项目名称和版本号</span></span>
<span class="line"><span>project(c-study VERSION 1.0 LANGUAGES C)</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 设置 C 标准</span></span>
<span class="line"><span>set(CMAKE_C_STANDARD 23)</span></span>
<span class="line"><span>set(CMAKE_C_STANDARD_REQUIRED True)</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 辅助函数用于递归查找所有源文件</span></span>
<span class="line"><span>function(collect_sources result dir)</span></span>
<span class="line"><span> file(GLOB_RECURSE new_sources &quot;\${dir}/*.c&quot;)</span></span>
<span class="line"><span> set(\${result} \${\${result}} \${new_sources} PARENT_SCOPE)</span></span>
<span class="line"><span>endfunction()</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 查找顶层 include 目录如果存在</span></span>
<span class="line"><span>if (EXISTS &quot;\${CMAKE_SOURCE_DIR}/include&quot;)</span></span>
<span class="line"><span> include_directories(\${CMAKE_SOURCE_DIR}/include)</span></span>
<span class="line"><span>endif ()</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 查找所有源文件</span></span>
<span class="line"><span>set(SOURCES)</span></span>
<span class="line"><span>collect_sources(SOURCES \${CMAKE_SOURCE_DIR})</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 用于存储已经处理过的可执行文件名防止重复</span></span>
<span class="line"><span>set(EXECUTABLE_NAMES)</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 创建可执行文件</span></span>
<span class="line"><span>foreach (SOURCE \${SOURCES})</span></span>
<span class="line"><span> # 获取文件的相对路径</span></span>
<span class="line"><span> file(RELATIVE_PATH REL_PATH \${CMAKE_SOURCE_DIR} \${SOURCE})</span></span>
<span class="line"><span> # 将路径中的斜杠替换为下划线生成唯一的可执行文件名</span></span>
<span class="line"><span> string(REPLACE &quot;/&quot; &quot;_&quot; EXECUTABLE_NAME \${REL_PATH})</span></span>
<span class="line"><span> string(REPLACE &quot;\\\\&quot; &quot;_&quot; EXECUTABLE_NAME \${EXECUTABLE_NAME})</span></span>
<span class="line"><span> string(REPLACE &quot;.&quot; &quot;_&quot; EXECUTABLE_NAME \${EXECUTABLE_NAME})</span></span>
<span class="line"><span></span></span>
<span class="line"><span> # 处理与 CMakeLists.txt 文件同名的问题</span></span>
<span class="line"><span> if (\${EXECUTABLE_NAME} STREQUAL &quot;CMakeLists_txt&quot;)</span></span>
<span class="line"><span> set(EXECUTABLE_NAME &quot;\${EXECUTABLE_NAME}_exec&quot;)</span></span>
<span class="line"><span> endif ()</span></span>
<span class="line"><span></span></span>
<span class="line"><span> # 检查是否已经创建过同名的可执行文件</span></span>
<span class="line"><span> if (NOT EXECUTABLE_NAME IN_LIST EXECUTABLE_NAMES)</span></span>
<span class="line"><span> list(APPEND EXECUTABLE_NAMES \${EXECUTABLE_NAME})</span></span>
<span class="line"><span></span></span>
<span class="line"><span> # 创建可执行文件</span></span>
<span class="line"><span> add_executable(\${EXECUTABLE_NAME} \${SOURCE})</span></span>
<span class="line"><span></span></span>
<span class="line"><span> # 查找源文件所在的目录并添加为包含目录头文件可能在同一目录下</span></span>
<span class="line"><span> get_filename_component(DIR \${SOURCE} DIRECTORY)</span></span>
<span class="line"><span> target_include_directories(\${EXECUTABLE_NAME} PRIVATE \${DIR})</span></span>
<span class="line"><span></span></span>
<span class="line"><span> # 检查并添加子目录中的 include 目录如果存在</span></span>
<span class="line"><span> if (EXISTS &quot;\${DIR}/include&quot;)</span></span>
<span class="line"><span> target_include_directories(\${EXECUTABLE_NAME} PRIVATE \${DIR}/include)</span></span>
<span class="line"><span> endif ()</span></span>
<span class="line"><span></span></span>
<span class="line"><span> # 检查并添加 module 目录中的所有 C 文件如果存在</span></span>
<span class="line"><span> if (EXISTS &quot;\${DIR}/module&quot;)</span></span>
<span class="line"><span> file(GLOB_RECURSE MODULE_SOURCES &quot;\${DIR}/module/*.c&quot;)</span></span>
<span class="line"><span> target_sources(\${EXECUTABLE_NAME} PRIVATE \${MODULE_SOURCES})</span></span>
<span class="line"><span> endif ()</span></span>
<span class="line"><span> endif ()</span></span>
<span class="line"><span>endforeach ()</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br></div></div><h2 id="_7-4--clang-format-" tabindex="-1">7.4 .clang-format <a class="header-anchor" href="#_7-4--clang-format-" aria-label="Permalink to &quot;7.4 .clang-format &quot;"></a></h2><ul><li> <code>.clang-format</code> 便 C </li></ul><p><img src="`+Ja+`" alt=""></p><ul><li><code>.clang-format</code> </li></ul><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>BasedOnStyle: Google</span></span>
<span class="line"><span>IndentWidth: 4</span></span>
<span class="line"><span>UseTab: Never</span></span>
<span class="line"><span>ColumnLimit: 0</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 控制大括号的位置</span></span>
<span class="line"><span>BreakBeforeBraces: Attach</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 控制空行的使用</span></span>
<span class="line"><span>EmptyLineBeforeAccessModifier: Never</span></span>
<span class="line"><span>KeepEmptyLinesAtTheStartOfBlocks: true</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 控制短函数 if 语句和循环的格式</span></span>
<span class="line"><span>AllowShortFunctionsOnASingleLine: Empty</span></span>
<span class="line"><span>AllowShortIfStatementsOnASingleLine: false</span></span>
<span class="line"><span>AllowShortLoopsOnASingleLine: false</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 控制其他格式选项</span></span>
<span class="line"><span>AlignConsecutiveAssignments: true</span></span>
<span class="line"><span>AlignConsecutiveDeclarations: true</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 控制注释的格式化</span></span>
<span class="line"><span>ReflowComments: true</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 控制包含指令的格式化</span></span>
<span class="line"><span>IncludeBlocks: Regroup</span></span>
<span class="line"><span>SortIncludes: CaseInsensitive</span></span>
<span class="line"><span></span></span>
<span class="line"><span>SpaceBeforeParens: ControlStatements</span></span>
<span class="line"><span>SpacesInParentheses: false</span></span>
<span class="line"><span>SpacesInAngles: false</span></span>
<span class="line"><span>SpacesInContainerLiterals: false</span></span>
<span class="line"><span>SpacesInCStyleCastParentheses: false</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br></div></div><ul><li>CLion <code></code><code></code></li></ul><p><img src="`+Ya+'" alt=""></p><h2 id="_7-5--gitignore-" tabindex="-1">7.5 .gitignore <a class="header-anchor" href="#_7-5--gitignore-" aria-label="Permalink to &quot;7.5 .gitignore &quot;"></a></h2><ul><li> <code>.gitignore</code> 便 Git </li></ul><p><img src="'+za+`" alt=""></p><ul><li><code>.gitignore</code> </li></ul><div class="language-txt vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">txt</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>.vscode</span></span>
<span class="line"><span>.idea</span></span>
<span class="line"><span>cmake-build-*</span></span>
<span class="line"><span>build</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><h2 id="_7-6-" tabindex="-1">7.6 <a class="header-anchor" href="#_7-6-" aria-label="Permalink to &quot;7.6 &quot;"></a></h2><ul><li></li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p><code> CMake </code></p></div><p><img src="`+Za+'" alt=""></p><h1 id="-c--" tabindex="-1">C <a class="header-anchor" href="#-c--" aria-label="Permalink to &quot;C &quot;"></a></h1><h2 id="_8-1-" tabindex="-1">8.1 <a class="header-anchor" href="#_8-1-" aria-label="Permalink to &quot;8.1 &quot;"></a></h2><ul><li>C </li></ul><p><img src="'+si+'" alt=""></p><ul><li> C </li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p> <code>.c</code> </p></div><ul><li> C <code></code> <code>.obj</code> <code>.o</code> C </li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li><p> <code></code><code></code><code></code><code></code></p></li><li><p> <code></code><code>#include</code><code>#define</code></p><ul><li><p><strong></strong><code>#include &lt;stdio.h&gt;</code><code>stdio.h</code></p></li><li><p><strong></strong><code>#define PI 3.14</code><code>PI</code><code>3.14</code></p></li><li><p><strong></strong><code>#ifdef</code><code>#ifndef</code></p></li><li><p><strong></strong></p></li><li><p><code>.i</code></p></li></ul></li><li><p> <code></code><code>.s</code></p></li><li><p> <code></code><code>.o</code> <code>.obj</code></p></li></ul></div><ul><li> <code>*.obj</code> <code>*.o</code><code></code> <code>*.exe</code></li></ul><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><ul><li></li><li><EFBFBD><EFBFBD>
<span class="line"><span>networkingMode=mirrored</span></span>
<span class="line"><span>dnsTunneling=true</span></span>
<span class="line"><span>firewall=true</span></span>
<span class="line"><span>autoProxy=true</span></span>
<span class="line"><span></span></span>
<span class="line"><span>[experimental]</span></span>
<span class="line"><span># requires dnsTunneling but are also OPTIONAL</span></span>
<span class="line"><span>bestEffortDnsParsing=true</span></span>
<span class="line"><span>useWindowsDnsCache=true</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br></div></div><p><img src="`+ti+'" alt=""></p><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">wsl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --shutdown</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+ri+'" alt=""></p><ul><li></li></ul><p><img src="'+hi+'" alt=""></p><h2 id="_9-2-clion-" tabindex="-1">9.2 CLion <a class="header-anchor" href="#_9-2-clion-" aria-label="Permalink to &quot;9.2 CLion &quot;"></a></h2><ul><li> CLion run <code>printf</code> <code>scanf</code> </li></ul><p><img src="'+ci+'" alt=""></p><ul><li> debug <code>printf</code> <code>scanf</code> </li></ul><p><img src="'+di+`" alt=""></p><ul><li> <code>scanf</code> <code>scanf</code> <code></code></li></ul><div class="language-c vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;stdio.h&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 禁用 stdout 缓冲区</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> setbuf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(stdout, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">NULL</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> a, b, c;</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot; a b c &quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> scanf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> %d</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> %d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&amp;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">a, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&amp;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">b, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&amp;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">c);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> result </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> a </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> b </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">*</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> c;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> printf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> × </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> × </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> = </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, a, b, c, result);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br></div></div><ul><li></li></ul><p><img src="`+oi+'" alt=""></p><h2 id="_9-3-" tabindex="-1">9.3 <a class="header-anchor" href="#_9-3-" aria-label="Permalink to &quot;9.3 &quot;"></a></h2><h3 id="_9-3-1-" tabindex="-1">9.3.1 <a class="header-anchor" href="#_9-3-1-" aria-label="Permalink to &quot;9.3.1 &quot;"></a></h3><ul><li>C 使C </li><li>使 <code>Valgrind</code> <code></code><code></code> <code>Valgrind</code> Linux </li></ul><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>win 11 WSL2 Linux Linux VMware Workstation Linux </p></div><h3 id="_9-3-2-" tabindex="-1">9.3.2 <a class="header-anchor" href="#_9-3-2-" aria-label="Permalink to &quot;9.3.2 &quot;"></a></h3><ul><li> WSL2 Valgrind </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;">dnf</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> upgrade</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">dnf</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> valgrind</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # AlmaLinux</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">apt</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> update</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">apt</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> upgrade</span><span style="--shiki-light:#24292
<span class="line"><span></span></span>
<span class="line"><span># 项目名称和版本号</span></span>
<span class="line"><span>project(c-study VERSION 1.0 LANGUAGES C)</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 设置 C 标准</span></span>
<span class="line"><span>set(CMAKE_C_STANDARD 23)</span></span>
<span class="line"><span>set(CMAKE_C_STANDARD_REQUIRED True)</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 辅助函数用于递归查找所有源文件</span></span>
<span class="line"><span>function(collect_sources result dir)</span></span>
<span class="line"><span> file(GLOB_RECURSE new_sources &quot;\${dir}/*.c&quot;)</span></span>
<span class="line"><span> set(\${result} \${\${result}} \${new_sources} PARENT_SCOPE)</span></span>
<span class="line"><span>endfunction()</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 查找顶层 include 目录如果存在</span></span>
<span class="line"><span>if (EXISTS &quot;\${CMAKE_SOURCE_DIR}/include&quot;)</span></span>
<span class="line"><span> include_directories(\${CMAKE_SOURCE_DIR}/include)</span></span>
<span class="line"><span>endif ()</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 查找所有源文件</span></span>
<span class="line"><span>set(SOURCES)</span></span>
<span class="line"><span>collect_sources(SOURCES \${CMAKE_SOURCE_DIR})</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 用于存储已经处理过的可执行文件名防止重复</span></span>
<span class="line"><span>set(EXECUTABLE_NAMES)</span></span>
<span class="line"><span></span></span>
<span class="line"><span># 创建可执行文件</span></span>
<span class="line"><span>foreach (SOURCE \${SOURCES})</span></span>
<span class="line"><span> # 获取文件的相对路径</span></span>
<span class="line"><span> file(RELATIVE_PATH REL_PATH \${CMAKE_SOURCE_DIR} \${SOURCE})</span></span>
<span class="line"><span> # 将路径中的斜杠替换为下划线生成唯一的可执行文件名</span></span>
<span class="line"><span> string(REPLACE &quot;/&quot; &quot;_&quot; EXECUTABLE_NAME \${REL_PATH})</span></span>
<span class="line"><span> string(REPLACE &quot;\\\\&quot; &quot;_&quot; EXECUTABLE_NAME \${EXECUTABLE_NAME})</span></span>
<span class="line"><span> string(REPLACE &quot;.&quot; &quot;_&quot; EXECUTABLE_NAME \${EXECUTABLE_NAME})</span></span>
<span class="line"><span></span></span>
<span class="line"><span> # 处理与 CMakeLists.txt 文件同名的问题</span></span>
<span class="line"><span> if (\${EXECUTABLE_NAME} STREQUAL &quot;CMakeLists_txt&quot;)</span></span>
<span class="line"><span> set(EXECUTABLE_NAME &quot;\${EXECUTABLE_NAME}_exec&quot;)</span></span>
<span class="line"><span> endif ()</span></span>
<span class="line"><span></span></span>
<span class="line"><span> # 检查是否已经创建过同名的可执行文件</span></span>
<span class="line"><span> if (NOT EXECUTABLE_NAME IN_LIST EXECUTABLE_NAMES)</span></span>
<span class="line"><span> list(APPEND EXECUTABLE_NAMES \${EXECUTABLE_NAME})</span></span>
<span class="line"><span></span></span>
<span class="line"><span> # 创建可执行文件</span></span>
<span class="line"><span> add_executable(\${EXECUTABLE_NAME} \${SOURCE})</span></span>
<span class="line"><span></span></span>
<span class="line"><span> # 查找源文件所在的目录并添加为包含目录头文件可能在同一目录下</span></span>
<span class="line"><span> get_filename_component(DIR \${SOURCE} DIRECTORY)</span></span>
<span class="line"><span> target_include_directories(\${EXECUTABLE_NAME} PRIVATE \${DIR})</span></span>
<span class="line"><span></span></span>
<span class="line"><span> # 检查并添加子目录中的 include 目录如果存在</span></span>
<span class="line"><span> if (EXISTS &quot;\${DIR}/include&quot;)</span></span>
<span class="line"><span> target_include_directories(\${EXECUTABLE_NAME} PRIVATE \${DIR}/include)</span></span>
<span class="line"><span> endif ()</span></span>
<span class="line"><span></span></span>
<span class="line"><span> # 检查并添加 module 目录中的所有 C 文件如果存在</span></span>
<span class="line"><span> if (EXISTS &quot;\${DIR}/module&quot;)</span></span>
<span class="line"><span> file(GLOB_RECURSE MODULE_SOURCES &quot;\${DIR}/module/*.c&quot;)</span></span>
<span class="line"><span> target_sources(\${EXECUTABLE_NAME} PRIVATE \${MODULE_SOURCES})</span></span>
<span class="line"><span> endif ()</span></span>
<span class="line"><span> endif ()</span></span>
<span class="line"><span>endforeach ()</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br></div></div><ul><li> CLion </li></ul><p><img src="`+Ei+'" alt=""></p><ul><li> CLion valgrind </li></ul><p><img src="'+Ci+'" alt=""></p><h2 id="_9-4-" tabindex="-1">9.4 <a class="header-anchor" href="#_9-4-" aria-label="Permalink to &quot;9.4 &quot;"></a></h2><h3 id="_9-4-1-" tabindex="-1">9.4.1 <a class="header-anchor" href="#_9-4-1-" aria-label="Permalink to &quot;9.4.1 &quot;"></a></h3><ul><li><code>perf</code> Linux </li></ul><h3 id="_9-4-2-" tabindex="-1">9.4.2 <a class="header-anchor" href="#_9-4-2-" aria-label="Permalink to &quot;9.4.2 &quot;"></a></h3><h4 id="_9-4-2-1-almalinux9" tabindex="-1">9.4.2.1 AlmaLinux9 <a class="header-anchor" href="#_9-4-2-1-almalinux9" aria-label="Permalink to &quot;9.4.2.1 AlmaLinux9&quot;"></a></h4><ul><li> WSL2 AlmaLinux perf </li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">apt</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> linux-tools-common</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> linux-tools-generic</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> linux-tools-</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">uname</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -r</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><p><img src="`+Fi+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p> WSL2 Ubuntu Ubuntu Canonical </p></div><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">uname</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -sr</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+_i+'" 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:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> KERNEL_VERSION</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">uname</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -r</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> cut</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;-&#39;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -f1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+vi+`" 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;">apt</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> update</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;&amp; </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> apt</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -y</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> binutils-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> debuginfod</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> default-jdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> default-jre</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libaio-dev</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libbabeltrace-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libcap-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libdw-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libdwarf-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libelf-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libiberty-dev</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> liblzma-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libnuma-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libperl-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libpfm4-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libslang2-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libssl-dev</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libtraceevent-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libunwind-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libzstd-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libzstd1</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> python3-setuptools</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> python3</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> python3-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> systemtap-sdt-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> zlib1g-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> bc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dwarves</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> bison</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> flex</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libnewt-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libdwarf++0</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libelf++0</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libbfb0-dev</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> python-dev-is-python3</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><p><img src="`+Bi+`" alt=""></p><ul><li></li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clone</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --depth</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --single-branch</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --branch=linux-msft-wsl-\${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">KERNEL_VERSION</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://github.com/microsoft/WSL2-Linux-Kernel.git</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><p><img src="`+Ai+'" alt=""></p><ul><li>编译内核代码:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> WSL2-Linux-Kernel</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">make</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -j</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">nproc</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">KCONFIG_CONFIG=Microsoft/config-wsl</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+fi+'" alt=""></p><ul><li>编译 perf 工具:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> tools/perf</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">make</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clean</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">make</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+xi+'" alt=""></p><ul><li>复制到 PATH 变量所指向的路径中:</li></ul><div class="language-shell vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">cp</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> perf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /usr/bin/</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="'+Di+'" alt=""></p><h3 id="_9-4-3-整合" tabindex="-1">9.4.3 整合 <a class="header-anchor" href="#_9-4-3-整合" aria-label="Permalink to &quot;9.4.3 整合&quot;"></a></h3><ul><li>CLion 中配置 perf 的路径:</li></ul><p><img src="'+qi+'" alt=""></p><ul><li>在 CLion 中通过 perf 运行代码:</li></ul><p><img src="'+Si+'" alt=""></p><h2 id="_9-5-win-中文乱码问题" tab