<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>初始化</title>
	<atom:link href="https://www.aitaocui.cn/tag/191870/feed" rel="self" type="application/rss+xml" />
	<link>https://www.aitaocui.cn</link>
	<description>翡翠玉石爱好者聚集地</description>
	<lastBuildDate>Wed, 23 Nov 2022 18:02:18 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>

<image>
	<url>https://www.aitaocui.cn/wp-content/uploads/2022/11/taocui.png</url>
	<title>初始化</title>
	<link>https://www.aitaocui.cn</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>初始化(计算机用语)</title>
		<link>https://www.aitaocui.cn/article/300088.html</link>
					<comments>https://www.aitaocui.cn/article/300088.html#respond</comments>
		
		<dc:creator><![CDATA[昆德拉]]></dc:creator>
		<pubDate>Wed, 23 Nov 2022 18:02:18 +0000</pubDate>
				<category><![CDATA[百科]]></category>
		<category><![CDATA[初始化]]></category>
		<guid isPermaLink="false">https://www.aitaocui.cn/?p=300088</guid>

					<description><![CDATA[初始化就是把变量赋为默认值，把控件设为默认状态，把没准备的准备好。 但是如果是整个系统初始化那就不一样了。在汇编语言中，为变量分配空间时，初始化过的变量的初值位于可执行文件代码段数...]]></description>
										<content:encoded><![CDATA[</p>
<article>
<p>初始化就是把变量赋为默认值，把控件设为默认状态，把没准备的准备好。 但是如果是整个系统初始化那就不一样了。在汇编语言中，为变量分配空间时，初始化过的变量的初值位于可执行文件代码段数据后，会占用一定空间，不必要的初始化会造成磁盘空间的浪费。在C语言等高级语言中，为每一个变量赋初值被视为良好的编程习惯。</p>
</article>
<article>
<h1>C系语言</h1>
<h2 id="a-e84a6709">工具</h2>
<p>在C/C99/C++中，初始化器是声明器的可选部分，它由一个&#x27;=&#x27;以及其后的一个表达式（或含有多个以&#x27;,&#x27;隔开的带圆括号表达式的单一列表）所组成。后面这一列表有时也被称为“初始化（器）列表”（initializer list）或”初始化列表”（initialization list），不过initializer list也是C++中用于初始化类或结构中的元素的保留字。一个包含初始化的声明则通常被称为定义。根据C++标准规定，定义是声明的一种；具体来说，声明只需为函数或数据对象指定类型即可，而定义则还必须为其赋初值。所以“声明和定义”的提法严格来说是不准确的，但这种说法仍被广为采用。</p>
<h2 id="a-b6df8123">默认</h2>
<p>在程序里，数据初始化也可能在没有由明确的语法来实现的情况下进行。例如说，如果一个静态变量在没有初始化（即未指定初值）的情况下被声明，则：对于原生数据类型：以对应类型的零值进行初始化；对于类中的静态对象：由其默认的构造函数来进行初始化。</p>
<h1>执行顺序</h1>
<p>每一个初始化部分里面的代码在程序运行后，或库的begin-end块运行之前。delphi使用对单元相关树的深度优先遍历来运行初始化部分。换句话说，就只在一个单元的初始化代码运行前，delphi就运行了特他使用的每一个单元的初始化部分。每一个单元仅初始化一次 。程序代码当中可以有Initialization声明部分。这部分里面的代码的执行，是在windows加载包含该单元（指Initialization所属单元）的模块（应用程序，DLL或者包）时运行的。一般来说是：先Initialization单元，然后interface单元，然后implementation单元。程序中Initialize过程。可以在这里初始化字符串、动态数组、接口和Variants。</p>
</article>
<div class="mt-3 mb-3" style="max-width: 770px;height: auto;">
                                    </div>
<div class="mt-3 mb-3" style="max-width: 770px;height: auto;">
                                    </div>
<div class="mt-3 mb-3" style="max-width: 770px;height: auto;">
                                    </div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.aitaocui.cn/article/300088.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
