c/assets/notes_01_c-basic_03_xdx_index.md.DWhca3VZ.js

2 lines
3.6 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as e,c as o,o as c,a5 as a}from"./chunks/framework.BE8if9e6.js";const d="/c/assets/1.L8V3GBrc.png",t="/c/assets/2.BkF1yWLn.png",x=JSON.parse('{"title":"第一章:数据类型(⭐)","description":"","frontmatter":{},"headers":[],"relativePath":"notes/01_c-basic/03_xdx/index.md","filePath":"notes/01_c-basic/03_xdx/index.md","lastUpdated":1721105900000}'),l={name:"notes/01_c-basic/03_xdx/index.md"},i=a('<h1 id="第一章-数据类型-⭐" tabindex="-1">第一章:数据类型(⭐) <a class="header-anchor" href="#第一章-数据类型-⭐" aria-label="Permalink to &quot;第一章:数据类型(⭐)&quot;"></a></h1><h2 id="_1-1-概述" tabindex="-1">1.1 概述 <a class="header-anchor" href="#_1-1-概述" aria-label="Permalink to &quot;1.1 概述&quot;"></a></h2><ul><li><p>根据<code>变量</code>中<code>存储</code>的<code>值</code>的<code>不同</code>,我们可以将<code>变量</code>分为两类:</p><ul><li><code>普通变量</code>:变量所对应的内存中存储的是<code>普通值</code>。</li><li><code>指针变量</code>:变量所对应的内存中存储的是<code>另一个变量的地址</code>。</li></ul></li><li><p>如下图所示:</p></li></ul><p><img src="'+d+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><p>普通变量和指针变量的相同点:</p><ul><li>普通变量有内存空间,指针变量也有内存空间。</li><li>普通变量有内存地址,指针变量也有内存地址。</li><li>普通变量所对应的内存空间中有值,指针变量所对应的内存空间中也有值。</li></ul><p>普通变量和指针变量的不同点:</p><ul><li>普通变量所对应的内存空间存储的是普通的值,如:整数、小数、字符等;指针变量所对应的内存空间存储的是另外一个变量的地址。</li><li>普通变量有普通变量的运算方式,而指针变量有指针变量的运算方式(后续讲解)。</li></ul></div><ul><li>那么,在 C 语言中变量的数据类型就可以这么划分,如下所示:</li></ul><p><img src="'+t+'" alt=""></p><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p></p><ul><li>根据<code>普通变量</code>中存储的<code>值</code>的类型不同,可以将<code>普通变量类型</code>划分为<code>基本数据类型</code>(整型、字符类型、浮点类型、布尔类型)和<code>复合数据类型</code>(数组类型、结构体类型、共用体类型、枚举类型)。</li><li>根据<code>指针变量</code>所<code>指向空间</code>存储<code>值</code>的类型不同,可以将<code>指针类型</code>分为<code>基本数据类型指针</code>、<code>复合数据类型指针</code>、<code>函数指针</code>、<code>数组指针</code>等,例如:如果指针所指向的空间保存的是 int 类型,那么该指针就是 int 类型的指针。</li></ul></div><h2 id="_1-2-整数类型" tabindex="-1">1.2 整数类型 <a class="header-anchor" href="#_1-2-整数类型" aria-label="Permalink to &quot;1.2 整数类型&quot;"></a></h2><h1 id="第二章-运算符" tabindex="-1">第二章:运算符 <a class="header-anchor" href="#第二章-运算符" aria-label="Permalink to &quot;第二章:运算符&quot;"></a></h1><h1 id="第三章-随机数" tabindex="-1">第三章:随机数 <a class="header-anchor" href="#第三章-随机数" aria-label="Permalink to &quot;第三章:随机数&quot;"></a></h1>',11),s=[i];function r(n,_,p,h,u,m){return c(),o("div",null,s)}const f=e(l,[["render",r]]);export{x as __pageData,f as default};