<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-CN">
		<id>http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=Sizeof%28%29</id>
		<title>Sizeof() - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=Sizeof%28%29"/>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Sizeof()&amp;action=history"/>
		<updated>2026-05-02T12:54:03Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Sizeof()&amp;diff=15763&amp;oldid=prev</id>
		<title>2016年5月23日 (一) 02:46 Pppeng</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Sizeof()&amp;diff=15763&amp;oldid=prev"/>
				<updated>2016-05-23T02:46:41Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;zh-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;2016年5月23日 (一) 02:46的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l40&quot; &gt;第40行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第40行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[https://www.microduino.cn/wiki/index.php/Arduino_%E8%AF%AD%E6%B3%95%E6%89%8B%E5%86%8C/zh 返回Arduino语法手册]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Pppeng</name></author>	</entry>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Sizeof()&amp;diff=15727&amp;oldid=prev</id>
		<title>2016年5月23日 (一) 02:26 Pppeng</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Sizeof()&amp;diff=15727&amp;oldid=prev"/>
				<updated>2016-05-23T02:26:16Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;zh-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;2016年5月23日 (一) 02:26的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;第1行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;sizeof()&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;sizeof()&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;运算符&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*'''描述'''&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*'''描述'''&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Pppeng</name></author>	</entry>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Sizeof()&amp;diff=15726&amp;oldid=prev</id>
		<title>Pppeng：创建页面，内容为“sizeof() *'''描述'''&lt;br&gt;  sizeof操作符返回一个变量类型的字节数，或者该数在数组中占有的字节数。&lt;br&gt; *'''语法'''&lt;br&gt; &lt;pre style=&quot;col...”</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Sizeof()&amp;diff=15726&amp;oldid=prev"/>
				<updated>2016-05-23T02:25:41Z</updated>
		
		<summary type="html">&lt;p&gt;创建页面，内容为“sizeof() *&amp;#039;&amp;#039;&amp;#039;描述&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;  sizeof操作符返回一个变量类型的字节数，或者该数在数组中占有的字节数。&amp;lt;br&amp;gt; *&amp;#039;&amp;#039;&amp;#039;语法&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt; &amp;lt;pre style=&amp;quot;col...”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;sizeof()&lt;br /&gt;
*'''描述'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sizeof操作符返回一个变量类型的字节数，或者该数在数组中占有的字节数。&amp;lt;br&amp;gt;&lt;br /&gt;
*'''语法'''&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:green&amp;quot;&amp;gt;&lt;br /&gt;
sizeof(variable)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''参数'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*variable: 任何变量类型或数组（如int，float，byte）&lt;br /&gt;
*'''示例代码'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sizeof操作符用来处理数组非常有效，它能很方便的改变数组的大小而不用破坏程序的其他部分。&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
这个程序一次打印出一个字符串文本的字符。尝试改变一下字符串。&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:green&amp;quot;&amp;gt;&lt;br /&gt;
char myStr[] = &amp;quot;this is a test&amp;quot;;&lt;br /&gt;
int i;&lt;br /&gt;
&lt;br /&gt;
void setup(){&lt;br /&gt;
  Serial.begin(9600);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop() { &lt;br /&gt;
  for (i = 0; i &amp;lt; sizeof(myStr) - 1; i++){&lt;br /&gt;
    Serial.print(i, DEC);&lt;br /&gt;
    Serial.print(&amp;quot; = &amp;quot;);&lt;br /&gt;
    Serial.write(myStr[i]);&lt;br /&gt;
    Serial.println();&lt;br /&gt;
  }&lt;br /&gt;
  delay(5000); // slow down the program&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
请注意sizeof返回字节数总数。因此，较大的变量类型，如整数，for循环看起来应该像这样。&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:green&amp;quot;&amp;gt;&lt;br /&gt;
for (i = 0; i &amp;lt; (sizeof(myInts)/sizeof(int)) - 1; i++) {&lt;br /&gt;
  //用myInts[i]来做些事&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pppeng</name></author>	</entry>

	</feed>