??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品久久久天天影视香蕉 ,色综合色天天久久婷婷基地,久久无码高潮喷水http://www.shnenglu.com/Leon916/category/8420.htmlzh-cnSun, 13 Sep 2009 12:11:57 GMTSun, 13 Sep 2009 12:11:57 GMT60归ƈ排序http://www.shnenglu.com/Leon916/archive/2009/09/13/96034.htmlLeon916Leon916Sun, 13 Sep 2009 02:28:00 GMThttp://www.shnenglu.com/Leon916/archive/2009/09/13/96034.htmlhttp://www.shnenglu.com/Leon916/comments/96034.htmlhttp://www.shnenglu.com/Leon916/archive/2009/09/13/96034.html#Feedback0http://www.shnenglu.com/Leon916/comments/commentRss/96034.htmlhttp://www.shnenglu.com/Leon916/services/trackbacks/96034.html帖子Q是关于归ƈ排序的,发现错误很隐蔽(在我看来Q,后来l过调试和跟t才扑ֈ?jin)这个错误。结果是一个很单的逻辑问题Q自己太W了(jin)Q花??个小时。哎Q还是看E序时粗枝大Ӟ

Leon916 2009-09-13 10:28 发表评论
]]>
STL源码阅读1http://www.shnenglu.com/Leon916/archive/2009/09/11/95969.htmlLeon916Leon916Fri, 11 Sep 2009 14:04:00 GMThttp://www.shnenglu.com/Leon916/archive/2009/09/11/95969.htmlhttp://www.shnenglu.com/Leon916/comments/95969.htmlhttp://www.shnenglu.com/Leon916/archive/2009/09/11/95969.html#Feedback0http://www.shnenglu.com/Leon916/comments/commentRss/95969.htmlhttp://www.shnenglu.com/Leon916/services/trackbacks/95969.html       单ȝ一下:(x) 目前看到的技巧有Qtraite技术,仿函敎ͼ()函数q算操作W的c?/span>Q。关于仿函数可以参看http://blog.csdn.net/kingofbirdzjy/archive/2007/12/10/1926653.aspx?

Leon916 2009-09-11 22:04 发表评论
]]>
重新开?/title><link>http://www.shnenglu.com/Leon916/archive/2009/09/11/95945.html</link><dc:creator>Leon916</dc:creator><author>Leon916</author><pubDate>Fri, 11 Sep 2009 09:08:00 GMT</pubDate><guid>http://www.shnenglu.com/Leon916/archive/2009/09/11/95945.html</guid><wfw:comment>http://www.shnenglu.com/Leon916/comments/95945.html</wfw:comment><comments>http://www.shnenglu.com/Leon916/archive/2009/09/11/95945.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/Leon916/comments/commentRss/95945.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/Leon916/services/trackbacks/95945.html</trackback:ping><description><![CDATA[       好长旉没有写程序了(jin)Q敲代码+调试׃(jin)?个小时时_(d)׃ؓ(f)?jin)一道特单题目(acm3299Q,以后要多多锻炼才行?br> 代码如下Q? <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008080"> 1</span><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">stdio.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 2</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">math.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 3</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br></span><span style="COLOR: #008080"> 4</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">float</span><span style="COLOR: #000000"> E </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">2.718281828</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080"> 5</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br></span><span style="COLOR: #008080"> 6</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> argc, </span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">argv[])<br></span><span style="COLOR: #008080"> 7</span><span style="COLOR: #000000"><img id=Codehighlighter1_101_1004_Open_Image onclick="this.style.display='none'; Codehighlighter1_101_1004_Open_Text.style.display='none'; Codehighlighter1_101_1004_Closed_Image.style.display='inline'; Codehighlighter1_101_1004_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_101_1004_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_101_1004_Closed_Text.style.display='none'; Codehighlighter1_101_1004_Open_Image.style.display='inline'; Codehighlighter1_101_1004_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_101_1004_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_101_1004_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 8</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">float</span><span style="COLOR: #000000"> t, d, h, e, hh;<br></span><span style="COLOR: #008080"> 9</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> index;<br></span><span style="COLOR: #008080">10</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> temp;<br></span><span style="COLOR: #008080">11</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080">12</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">( (scanf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%c</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">temp) </span><span style="COLOR: #000000">==</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">) </span><span style="COLOR: #000000">&&</span><span style="COLOR: #000000"> (temp </span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">E</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">))<br></span><span style="COLOR: #008080">13</span><span style="COLOR: #000000"><img id=Codehighlighter1_204_991_Open_Image onclick="this.style.display='none'; Codehighlighter1_204_991_Open_Text.style.display='none'; Codehighlighter1_204_991_Closed_Image.style.display='inline'; Codehighlighter1_204_991_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_204_991_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_204_991_Closed_Text.style.display='none'; Codehighlighter1_204_991_Open_Image.style.display='inline'; Codehighlighter1_204_991_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span id=Codehighlighter1_204_991_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_204_991_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">14</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        index </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">15</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">( </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000"> ; i </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br></span><span style="COLOR: #008080">16</span><span style="COLOR: #000000"><img id=Codehighlighter1_251_524_Open_Image onclick="this.style.display='none'; Codehighlighter1_251_524_Open_Text.style.display='none'; Codehighlighter1_251_524_Closed_Image.style.display='inline'; Codehighlighter1_251_524_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_251_524_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_251_524_Closed_Text.style.display='none'; Codehighlighter1_251_524_Open_Image.style.display='inline'; Codehighlighter1_251_524_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>        </span><span id=Codehighlighter1_251_524_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_251_524_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">17</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">switch</span><span style="COLOR: #000000">(temp)<br></span><span style="COLOR: #008080">18</span><span style="COLOR: #000000"><img id=Codehighlighter1_272_498_Open_Image onclick="this.style.display='none'; Codehighlighter1_272_498_Open_Text.style.display='none'; Codehighlighter1_272_498_Closed_Image.style.display='inline'; Codehighlighter1_272_498_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_272_498_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_272_498_Closed_Text.style.display='none'; Codehighlighter1_272_498_Open_Image.style.display='inline'; Codehighlighter1_272_498_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>            </span><span id=Codehighlighter1_272_498_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_272_498_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">19</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">case</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">:<br></span><span style="COLOR: #008080">20</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                index </span><span style="COLOR: #000000">|=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0x1</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">21</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                scanf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%f</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">t);<br></span><span style="COLOR: #008080">22</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #0000ff">break</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">23</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">case</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">D</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">:<br></span><span style="COLOR: #008080">24</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                index </span><span style="COLOR: #000000">|=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0x2</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">25</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                scanf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%f</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">d);<br></span><span style="COLOR: #008080">26</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #0000ff">break</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">27</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">case</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">H</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">:<br></span><span style="COLOR: #008080">28</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                index </span><span style="COLOR: #000000">|=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0x4</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">29</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                scanf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%f</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">h);<br></span><span style="COLOR: #008080">30</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #0000ff">break</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">31</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">default</span><span style="COLOR: #000000">:<br></span><span style="COLOR: #008080">32</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                i</span><span style="COLOR: #000000">--</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">33</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #0000ff">break</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">34</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>            }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">35</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            scanf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%c</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">temp);<br></span><span style="COLOR: #008080">36</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>        }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">37</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        </span><span style="COLOR: #0000ff">switch</span><span style="COLOR: #000000">(index)<br></span><span style="COLOR: #008080">38</span><span style="COLOR: #000000"><img id=Codehighlighter1_544_942_Open_Image onclick="this.style.display='none'; Codehighlighter1_544_942_Open_Text.style.display='none'; Codehighlighter1_544_942_Closed_Image.style.display='inline'; Codehighlighter1_544_942_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_544_942_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_544_942_Closed_Text.style.display='none'; Codehighlighter1_544_942_Open_Image.style.display='inline'; Codehighlighter1_544_942_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>        </span><span id=Codehighlighter1_544_942_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_544_942_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">39</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            <br></span><span style="COLOR: #008080">40</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        </span><span style="COLOR: #0000ff">case</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">:  </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> t d</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">41</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">            e </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">6.11</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> exp(</span><span style="COLOR: #000000">5417.7530</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">((</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">273.16</span><span style="COLOR: #000000">) </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">(d</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">273.16</span><span style="COLOR: #000000">))));<br></span><span style="COLOR: #008080">42</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            hh </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> (</span><span style="COLOR: #000000">0.5555</span><span style="COLOR: #000000">) </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> (e </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">10.0</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008080">43</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            h </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> t </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> hh;<br></span><span style="COLOR: #008080">44</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">break</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">45</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        </span><span style="COLOR: #0000ff">case</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">6</span><span style="COLOR: #000000">:        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">d, h ----t</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">46</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">            e </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">6.11</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> exp(</span><span style="COLOR: #000000">5417.7530</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">((</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">273.16</span><span style="COLOR: #000000">) </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">(d</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">273.16</span><span style="COLOR: #000000">))));<br></span><span style="COLOR: #008080">47</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            t </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> h </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0.5555</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> (e </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">10.0</span><span style="COLOR: #000000">); <br></span><span style="COLOR: #008080">48</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">break</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">49</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        </span><span style="COLOR: #0000ff">case</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">:            </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">t h ---d</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">50</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">            </span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> e;<br></span><span style="COLOR: #008080">51</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            e </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> (h</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">t)</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">0.5555</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">10.0</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">52</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            d </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">((</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">273.16</span><span style="COLOR: #000000">) </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000"> (log(e</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">6.11</span><span style="COLOR: #000000">))</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">5417.753</span><span style="COLOR: #000000">) </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">273.16</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">53</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">break</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">54</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>        }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">55</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">T %.1f D %.1f H %.1f\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">, t, d, h);<br></span><span style="COLOR: #008080">56</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">57</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">58</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">59</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span></div> <img src ="http://www.shnenglu.com/Leon916/aggbug/95945.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/Leon916/" target="_blank">Leon916</a> 2009-09-11 17:08 <a href="http://www.shnenglu.com/Leon916/archive/2009/09/11/95945.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>C语言文gdhttp://www.shnenglu.com/Leon916/archive/2009/04/10/79456.htmlLeon916Leon916Fri, 10 Apr 2009 03:02:00 GMThttp://www.shnenglu.com/Leon916/archive/2009/04/10/79456.htmlhttp://www.shnenglu.com/Leon916/comments/79456.htmlhttp://www.shnenglu.com/Leon916/archive/2009/04/10/79456.html#Feedback1http://www.shnenglu.com/Leon916/comments/commentRss/79456.htmlhttp://www.shnenglu.com/Leon916/services/trackbacks/79456.html
int main(int argc, char *argv[])
{
    FILE 
*file;
    FILE 
*fw;
    
if( (file = fopen("main.cpp""r")) == NULL)
        
return -1;
    
if( (fw = fopen("text.txt""wt")) == NULL)
        
return -1;

    
char ch;
    
while( (ch=fgetc(file)) != EOF )
    {
        fputc(ch, fw);
        printf(
"%c", ch);
    }

    fclose(file);
    fclose(fw);
    
return 0;
}

    
//char ch[LEN] = {0};
    
//while( !feof(file) )
    
//{
    
//    fread(ch, sizeof(char), LEN-1, file);
    
//    printf("%s", ch);
    
//    fwrite(ch, sizeof(char), LEN-1, fw);
    
//    memset(ch, 0, sizeof(char)*LEN);
    
//}
q是用通过调用c语言的库文g来实现?br>以下是用C++的中的stream来实现的Q但是在处理中文的时候,?x)出C些ؕ码?br>
//fstream fs;
//    fs.open(_T("文本.txt"));
//
//    char arr[LEN] = {0};
//    wchar_t temp[2*LEN+1] = {0};
//    int length;
//    if(!fs)
//    {
//        cout << "Error" << endl;
//        return -1;
//    }
    
//while(!fs.eof())
    
//{
    
//    fs.read(arr, sizeof(arr)-1);
    
//    length = MultiByteToWideChar(CP_ACP, 0, arr, -1, NULL, NULL);
    
//    MultiByteToWideChar(CP_ACP, 0, arr, -1, temp, length);
    
//    wcout.imbue(locale("chs"));
    
//    wcout << temp;
    
//}
但是通过charcdq行d却不出现qQ感觉很奇怪?br>
int main(int argc, char *argv[])
{
    fstream fs;
    fs.open(_T(
"文本.txt"));

    fstream fw;
    fw.open(
"text.txt");
    
char arr[LEN] = {0};
    wchar_t temp[
2*LEN+1= {0};
    
int length;
    
if(!fs || !fw)
    {
        cout 
<< "Error" << endl;
        
return -1;
    }
    
while(!fs.eof())
    {
        fs.read(arr, 
sizeof(arr)-1);
        cout 
<< arr;
        fw.write(arr, 
sizeof(arr)-1);
        memset(arr, 
0sizeof(arr));

    }
    cout 
<< endl;
    fs.close();
    fw.close();
    
return 0;
}




Leon916 2009-04-10 11:02 发表评论
]]>
一个Java的B-Tree源代?/title><link>http://www.shnenglu.com/Leon916/archive/2009/03/29/78271.html</link><dc:creator>Leon916</dc:creator><author>Leon916</author><pubDate>Sun, 29 Mar 2009 07:54:00 GMT</pubDate><guid>http://www.shnenglu.com/Leon916/archive/2009/03/29/78271.html</guid><wfw:comment>http://www.shnenglu.com/Leon916/comments/78271.html</wfw:comment><comments>http://www.shnenglu.com/Leon916/archive/2009/03/29/78271.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.shnenglu.com/Leon916/comments/commentRss/78271.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/Leon916/services/trackbacks/78271.html</trackback:ping><description><![CDATA[    q是我在看一个Java开源Y件的时候,发现一个h写的代码Q里面有三个函数到现在还没有看懂Q先攑֜blog里面? <img src ="http://www.shnenglu.com/Leon916/aggbug/78271.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/Leon916/" target="_blank">Leon916</a> 2009-03-29 15:54 <a href="http://www.shnenglu.com/Leon916/archive/2009/03/29/78271.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>std:string学习(fn)http://www.shnenglu.com/Leon916/archive/2008/12/05/68694.htmlLeon916Leon916Fri, 05 Dec 2008 14:33:00 GMThttp://www.shnenglu.com/Leon916/archive/2008/12/05/68694.htmlhttp://www.shnenglu.com/Leon916/comments/68694.htmlhttp://www.shnenglu.com/Leon916/archive/2008/12/05/68694.html#Feedback3http://www.shnenglu.com/Leon916/comments/commentRss/68694.htmlhttp://www.shnenglu.com/Leon916/services/trackbacks/68694.html之所以抛弃char*的字W串而选用C++标准E序库中的stringc,是因Z和前者比较v来,不必担心(j)内存是否_、字W串长度{等Q而且? Z个类出现Q他集成的操作函数以完成我们大多数情况?甚至?00%)的需要。我们可以用 = q行赋值操作,== q行比较Q? 做串联(是不是很?Q。我们尽可以把它看成是C++的基本数据类型?br>   好了(jin)Q进入正?#8230;……
首先Qؓ(f)?jin)在我们的程序中使用stringcdQ我们必d含头文g 。如下:(x)
   #include //注意q里不是string.h string.h是C字符串头文g

1Q声明一个C++字符?br>声明一个字W串变量很简单:(x)
   string Str;
q样我们声明了(jin)一个字W串变量Q但既然是一个类Q就有构造函数和析构函数。上面的声明没有传入参数Q所以就直接使用?jin)string的默认的构造函敎ͼq个函数所作的是把Str初始化ؓ(f)一个空字符丌ӀStringcȝ构造函数和析构函数如下Q?br>a)    string s;  //生成一个空字符串s
b)    string s(str) //拯构造函?生成str的复制品
c)    string s(str,stridx) //字W串str?#8220;始于位置stridx”的部分当作字W串的初?br>d)    string s(str,stridx,strlen) //字W串str?#8220;始于stridx且长度顶多strlen”的部分作为字W串的初?br>e)    string s(cstr) //C字符串作为s的初?br>f)    string s(chars,chars_len) //C字符串前chars_len个字W作为字W串s的初倹{?br>g)    string s(num,c) //生成一个字W串Q包含num个c字符
h)    string s(beg,end) //以区间beg;end(不包含end)内的字符作ؓ(f)字符串s的初?br>i)    s.~string() //销毁所有字W,释放内存
都很单,我就不解释了(jin)?br>2Q字W串操作函数
   q里是C++字符串的重点Q我先把各种操作函数|列出来Q不喜欢把所有函数都看完的h可以在这里找自己喜欢的函敎ͼ再到后面看他的详l解释?br>a) =,assign()   //赋以新?br>b) swap()   //交换两个字符串的内容
c) +=,append(),push_back() //在尾部添加字W?br>d) insert() //插入字符
e) erase() //删除字符
f) clear() //删除全部字符
g) replace() //替换字符
h) + //串联字符?br>i) ==,!=,<,<=,>,>=,compare()  //比较字符?br>j) size(),length()  //q回字符数量
k) max_size() //q回字符的可能最大个?br>l) empty()  //判断字符串是否ؓ(f)I?br>m) capacity() //q回重新分配之前的字W容?br>n) reserve() //保留一定量内存?sh)容U一定数量的字符
o) [ ], at() //存取单一字符
p) >>,getline() //从streamd某?br>q) <<  //谋值写入stream
r) copy() //某Dgؓ(f)一个C_string
s) c_str() //内容以C_stringq回
t) data() //内容以字符数组形式q回
u) substr() //q回某个子字W串
v)查找函数
w)begin() end() //提供cMSTL的P代器支持
x) rbegin() rend() //逆向q代?br>y) get_allocator() //q回配置?br>下面详细介绍Q?br>2Q? C++字符串和C字符串的转换
   C++提供的由C++字符串得到对应的C_string的方法是使用data()、c_str()和copy()Q其中,data()以字W数l的形式 q回字符串内容,但ƈ不添?#8217;\0’。c_str()q回一个以‘\0’l尾的字W数l,而copy()则把字符串的内容复制或写入既有的 c_string或字W数l内。C++字符串ƈ不以’\0’l尾。我的徏议是在程序中能用C++字符串就使用Q除非万不得已不选用c_string。由 于只是简单介l,详细介绍掠过Q谁惌一步了(jin)解用中的注意事可以给我留a(到我的收件箱)。我详细解释?br>2Q? 大小和容量函?br>   一个C++字符串存在三U大:(x)a)现有的字W数Q函数是size()和length()Q他们等效。Empty()用来(g)查字W串是否为空? b)max_size() q个大小是指当前C++字符串最多能包含的字W数Q很可能和机器本w的限制或者字W串所在位|连l内存的大小有关pR我们一般情况下不用兛_(j)他,应该大小 _我们用的。但是不够用的话Q会(x)抛出length_error异常c)capacity()重新分配内存?sh)? string所能包含的最大字W数。这里另一个需要指出的是reserve()函数Q这个函Cؓ(f)string重新分配内存。重新分配的大小由其参数军_Q? 默认参数?Q这时候会(x)对stringq行非强制性羃减?br>
q有必要再重复一下C++字符串和C字符串{换的问题Q许多h?x)遇到这L(fng)? 题,自己做的E序要调用别人的函数、类什么的Q比如数据库q接函数Connect(char*,char*)Q,但别人的函数参数用的是char*形式 的,而我们知道,c_str()、data()q回的字W数l由该字W串拥有Q所以是一Uconst char*,要想作ؓ(f)上面提及(qing)的函数的参数Q还必须拯C个char*,而我们的原则是能不用C字符串就不用。那么,q时候我们的处理方式是:(x)如果 此函数对参数(也就是char*)的内容不修改的话Q我们可以这样Connect((char*)UserID.c_str(), (char*)PassWD.c_str()),但是q时候是存在危险的,因ؓ(f)q样转换后的字符串其实是可以修改的(有兴地可以自己试一试)(j)Q所以我? 调除非函数调用的时候不对参数进行修改,否则必须拯C个char*上去。当?dng)更稳妥的办法是无Z么情况都拯C个char*上去。同时我们也? L(fng)在仍然用C字符串进行编E的高手们(说他们是高手一点儿也不Q也许在我们q穿开裆裤的时候他们就开始编E了(jin)Q哈?#8230;Q写的函数都比较规范Q那? 我们׃必进行强制{换了(jin)?br>
2Q?元素存取
   我们可以使用下标操作W[]和函数at()对元素包含的字符q行讉K。但是应该注意的是操作符[]q不(g)查烦(ch)引是否有效(有效索引 0~str.length()Q,如果索引失效Q会(x)引v未定义的行ؓ(f)。而at()?x)检查,如果使用at()的时候烦(ch)引无效,?x)抛? out_of_range异常?br>   有一个例外不得不_(d)const string a;的操作符[]对烦(ch)引值是a.length()仍然有效Q其q回值是’\0’。其他的各种情况Qa.length()索引都是无效的。D例如下:(x)
const string Cstr(“const string”);
string Str(“string”);

Str[3];    //ok
Str.at(3);  //ok

Str[100]; //未定义的行ؓ(f)
Str.at(100);  //throw out_of_range

Str[Str.length()]  //未定义行?br>Cstr[Cstr.length()] //q回 ‘\0’
Str.at(Str.length());//throw out_of_range
Cstr.at(Cstr.length()) ////throw out_of_range

我不赞成cM于下面的引用或指针赋|(x)
char& r=s[2];
char* p= &s[3];
因ؓ(f)一旦发生重新分配,r,p立即失效。避免的Ҏ(gu)是不用?br>
2Q?比较函数
   C++字符串支持常见的比较操作W(>,>=,<,<=,==,!=Q,甚至支持string与C-string的比?? str<”hello”)。在使用>,>=,<,<=q些操作W的时候是Ҏ(gu)“当前字符Ҏ(gu)?#8221;字W按字典序q行逐一? 比较。字典排序靠前的字符,比较的顺序是从前向后比较Q遇C相等的字W就按这个位|上的两个字W的比较l果定两个字符串的大小。同 Ӟstring(“aaaa”)    另一个功能强大的比较函数是成员函数compare()。他支持多参数处理,支持用烦(ch)引值和长度定位子串来进行比较。他q回一个整数来表示比较l果Q返 回值意义如下:(x)0-相等 ?-大于 <0-于。D例如下:(x)
   string s(“abcd”);
   
   s.compare(“abcd”); //q回0
   s.compare(“dcba”); //q回一个小?的?br>   s.compare(“ab”); //q回大于0的?br>   
s.compare(s); //相等
   s.compare(0,2,s,2,2); //?#8221;ab”?#8221;cd”q行比较 于?br>   s.compare(1,2,”bcx”,2); //?#8221;bc”?#8221;bc”比较?br>怎么P功能够全的吧Q什么?q(sh)能满你的胃口?好吧Q那{着Q后面有更个性化的比较算法。先l个提示Q用的是STL的比较算法。什么?对STL一H不通?靠,你重修吧Q?br>
2Q? 更改内容
q在字符串的操作中占?jin)很大一部分?br>首先讲赋|W一个赋值方法当然是使用操作W?Q新值可以是string(如:(x)s=ns) 、c_string(如:(x)s=”gaint”)甚至单一字符Q如Qs=’j’Q。还可以使用成员函数assign()Q这个成员函数可以你更灉|的对字符串赋倹{还是D例说明吧Q?br>s.assign(str); //不说
s.assign(str,1,3);//如果str?#8221;iamangel” 是?#8221;ama”赋给字符?br>s.assign(str,2,string::npos);//把字W串str从烦(ch)引?开始到l尾赋给s
s.assign(“gaint”); //不说
s.assign(“nico”,5);//?#8217;n’ ‘I’ ‘c’ ‘o’ ‘\0’赋给字符?br>s.assign(5,’x’);//把五个x赋给字符?br>把字W串清空的方法有三个Qs=””;s.clear();s.erase();(我越来越觉得举例比说话让别hҎ(gu)懂!)?br>string提供?jin)很多函数用于插入(insertQ、删除(eraseQ、替换(replaceQ、增加字W?br>先说增加字符Q这里说的增加是在尾巴上Q,函数?+=、append()、push_back()。D例如下:(x)
s+=str;//加个字符?br>s+=”my name is jiayp”;//加个C字符?br>s+=’a’;//加个字符

s.append(str);
s.append(str,1,3);//不解释了(jin) 同前面的函数参数assign的解?br>s.append(str,2,string::npos)//不解释了(jin)

s.append(“my name is jiayp”);
s.append(“nico”,5);
s.append(5,’x’);

 

    字符串操作是一个不的主题,在标准C++?string字符串类成ؓ(f)一个标?之所以抛弃char*的字W串而选用C++标准E序库中的stringc,是因Z和前者比较v来,不必担心(j)内存是否_、字W串长度{等Q而且作ؓ(f)一个类出现Q他集成的操作函数以完成我们大多数情况下的需?
    下面我们首先从一些示例开始学?fn)下stringcȝ使用.
1)
#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s("hehe");
    cout<<s<<endl;
    cin.get();
}
2)
#include <string>
#include <iostream>
using namespace std;

void main()
{
    char chs[] = "hehe";
    string s(chs);
    cout<<s<<endl;
    cin.get();
}
3)
#include <string>
#include <iostream>
using namespace std;

void main()
{
    char chs[] = "hehe";
    string s(chs,1,3);    //指定从chs的烦(ch)?开?最后复?个字?br>    cout<<s<<endl;
    cin.get();
}
4)
#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s1("hehe");
    string s2(s1);   
    cout<<s2<<endl;
    cin.get();
}
5)
#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s1("hehe",2,3);
    string s2(s1);   
    cout<<s2<<endl;
    cin.get();
}
6)
#include <string>
#include <iostream>
using namespace std;

void main()
{
    char chs[] = "hehe";
    string s(chs,3);    //chs?个字W作为初值构?br>    cout<<s<<endl;
    cin.get();
}
7)
#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s(10,'k');    //分配10个字W?初值都?k'
    cout<<s<<endl;
    cin.get();
}
//以上是stringcd例的构造手D?都很?

9)
//赋新?br>#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s(10,'k');    //分配10个字W?初值都?k'
    cout<<s<<endl;
    s = "hehehehe";
    cout<<s<<endl;
    s.assign("kdje");
    cout<<s<<endl;
    s.assign("fkdhfkdfd",5);    //重新分配指定字符串的?的元素内?br>    cout<<s<<endl;       
    cin.get();
}
10)
//swapҎ(gu)交换
#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s1 = "hehe";
    string s2 = "gagaga";
    cout<<"s1 : "<<s1<<endl;
    cout<<"s2 : "<<s2<<endl;
    s1.swap(s2);
    cout<<"s1 : "<<s1<<endl;
    cout<<"s2 : "<<s2<<endl;
    cin.get();
}
11)
//+=,append(),push_back()在尾部添加字W?br>#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s = "hehe";
    s += "gaga";
    cout<<s<<endl;
    s.append("嘿嘿");    //append()Ҏ(gu)可以d字符?br>    cout<<s<<endl;
    s.push_back('k');    //push_back()Ҏ(gu)只能d一个字W?..
    cout<<s<<endl;
    cin.get();
}
12)
//insert() 插入字符.其实,insertq用?与其他的插入操作是一L(fng).
#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s = "hehe";
    s.insert(0,"头部");            //在头部插?br>    s.insert(s.size(),"N");    //在尾部插?br>    s.insert(s.size()/2,"中间");//在中间插?br>    cout<<s<<endl;
    cin.get();
}
13)
#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s = "abcdefg";
    s.erase(0,1);    //从烦(ch)?到烦(ch)?,卛_除掉?a'
    cout<<s<<endl;
    //其实,q可以用replaceҎ(gu)来执行删除操?br>    s.replace(2,3,"");//卛_指定范围内的字符替换?",卛_相删除了(jin)
    cout<<s<<endl;
    cin.get();
}

14)
//clear() 删除全部字符
#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s = "abcdefg";
    cout<<s.length()<<endl;
    s.clear();
    cout<<s.length()<<endl;
    //使用earseҎ(gu)变相全删?br>    s = "dkjfd";
    cout<<s.length()<<endl;
    s.erase(0,s.length());
    cout<<s.length()<<endl;

    cin.get();
}
15)
//replace() 替换字符
#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s = "abcdefg";
    s.replace(2,3,"!!!!!");//从烦(ch)?开?个字节的字符全替换成"!!!!!"
    cout<<s<<endl;
    cin.get();
}
16)
//==,!=,<,<=,>,>=,compare()  比较字符?br>#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s1 = "abcdefg";
    string s2 = "abcdefg";   
    if (s1==s2)cout<<"s1 == s2"<<endl;
    else cout<<"s1 != s2"<<endl;
   
    if (s1!=s2)cout<<"s1 != s2"<<endl;
    else cout<<"s1 == s2"<<endl;
   
    if (s1>s2)cout<<"s1 > s2"<<endl;
    else cout<<"s1 <= s2"<<endl;
   
    if (s1<=s2)cout<<"s1 <= s2"<<endl;
    else cout<<"s1 > s2"<<endl;

    cin.get();
}
17)
//size(),length()  q回字符数量
#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s = "abcdefg";
    cout<<s.size()<<endl;
    cout<<s.length()<<endl;

    cin.get();
}
18)
//max_size() q回字符的可能最大个?br>#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s = "abcdefg";
    cout<<s.max_size()<<endl;

    cin.get();
}
19)
//empty()  判断字符串是否ؓ(f)I?br>#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s ;
    if (s.empty())
        cout<<"s 为空."<<endl;
    else
        cout<<"s 不ؓ(f)I?"<<endl;

    s = s + "abcdefg";
    if (s.empty())
        cout<<"s 为空."<<endl;
    else
        cout<<"s 不ؓ(f)I?"<<endl;

    cin.get();
}
20)
// [ ], at() 存取单一字符
#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s = "abcdefg1111";
   
    cout<<"use []:"<<endl;
    for(int i=0; i<s.length(); i++)
    {
        cout<<s[i]<<endl;
    }
    cout<<endl;

    cout<<"use at():"<<endl;
    for(int i=0; i<s.length(); i++)
    {
        cout<<s.at(i)<<endl;
    }
    cout<<endl;
   
    cin.get();
}
21)
#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s = "abcdefg1111";
   
    const char * chs1 = s.c_str();
    const char * chs2 = s.data();

    cout<<"use at():"<<endl;
    int i;
    for(i=0; i<s.length(); i++)
    {
        cout<<"c_str() : "<<chs1[i]<<endl;
        cout<<"data() : "<<chs2[i]<<endl;
    }
    cout<<"c_str() : "<<chs1<<endl;
    cout<<"data() : "<<chs2<<endl;
    cout<<endl;
   
    cin.get();
}
22)
// substr() q回某个子字W串
#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s = "abcdefg1111";
   
    string str = s.substr(5,3);//从烦(ch)?开?个字?br>    cout<<str<<endl;
   
    cin.get();
}
23)
// find 查找函数
#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s = "abcdefg1111";
    string pattern = "fg";
    string::size_type pos;
    pos = s.find(pattern,0);        //从烦(ch)?开?查找W合字符?f"的头索引
    cout<<pos<<endl;
    string str = s.substr(pos,pattern.size());
    cout<<str<<endl;
    cin.get();
}
24)
// begin() end() 提供cMSTL的P代器支持
#include <string>
#include <iostream>
using namespace std;

void main()
{
    string s = "abcdefg1111";
    for(string::iterator iter = s.begin(); iter!=s.end(); iter++)
    {
        cout<<*iter<<endl;
    }
    cout<<endl;

    cin.get();
}
        一个C++字符串存在三U大:(x)a)现有的字W数Q函数是size()和length()Q他们等效? Empty()用来(g)查字W串是否为空。b)max_size() q个大小是指当前C++字符串最多能包含的字W数Q很可能和机器本w的限制或者字W串所在位|连l内存的大小有关pR我们一般情况下不用兛_(j)他,应该大小 _我们用的。但是不够用的话Q会(x)抛出length_error异常c)capacity()重新分配内存?sh)? string所能包含的最大字W数。这里另一个需要指出的是reserve()函数Q这个函Cؓ(f)string重新分配内存。重新分配的大小由其参数军_Q? 默认参数?Q这时候会(x)对stringq行非强制性羃?/span>

Leon916 2008-12-05 22:33 发表评论
]]>
std::Vector学习(fn)http://www.shnenglu.com/Leon916/archive/2008/12/05/68638.htmlLeon916Leon916Fri, 05 Dec 2008 05:21:00 GMThttp://www.shnenglu.com/Leon916/archive/2008/12/05/68638.htmlhttp://www.shnenglu.com/Leon916/comments/68638.htmlhttp://www.shnenglu.com/Leon916/archive/2008/12/05/68638.html#Feedback0http://www.shnenglu.com/Leon916/comments/commentRss/68638.htmlhttp://www.shnenglu.com/Leon916/services/trackbacks/68638.html 按上面的语法Q创Z个vectorQ是按照v?span style="color: #ff0000;">实际元素个数创徏新vector的。就是说Q如果v中元素是1,2,3,那么QvNew中的元素?,2,3Qƈ且,vNew?span style="color: #ff0000;">d?/span>也是3.
也就是:(x)vNew的d量取决于v的实际元素个数?/span>

pVec->clear();
clear()只是删除[first,last)区间中的所有元素,但ƈ不释攑օ内存?

(std::vector  <int >)(*pVec)
也就是创Z个(f)时对象vector <int>Q显?dng)q个临时对象的d量是取决?pVec的实际元素个数的Q而经q?
pVec->clear();的pVect的实际元素个数是0Q因此,pVec- >swap( (std::vector  <int >)(*pVec) ); 这个(f)时对象与pVec交换后,它的d量变成了(jin)0?
Qvector中的swap()实现的是Q将first、last,end_of_storageQd量)(j)依次交换Q?

因此Q实C(jin)*pVec没用内存的释放?

Leon916 2008-12-05 13:21 发表评论
]]>
W试?http://www.shnenglu.com/Leon916/archive/2008/10/28/65277.htmlLeon916Leon916Tue, 28 Oct 2008 00:54:00 GMThttp://www.shnenglu.com/Leon916/archive/2008/10/28/65277.htmlhttp://www.shnenglu.com/Leon916/comments/65277.htmlhttp://www.shnenglu.com/Leon916/archive/2008/10/28/65277.html#Feedback0http://www.shnenglu.com/Leon916/comments/commentRss/65277.htmlhttp://www.shnenglu.com/Leon916/services/trackbacks/65277.htmlcout << sizeof*(p) << endl;
请问q个的输出?

l过调试Q我发现sizeofQ(p)(j)的值是p类型所占的字节数?br>char输出?QdoubleQ?.


char x[0];
x是什么类型?
我在VS2005下调试,l果是错?nbsp; cannot allocate an array of constant size 0 ?br>

Leon916 2008-10-28 08:54 发表评论
]]>
sizeof 用法ȝQ{Q?/title><link>http://www.shnenglu.com/Leon916/archive/2008/10/27/65250.html</link><dc:creator>Leon916</dc:creator><author>Leon916</author><pubDate>Mon, 27 Oct 2008 14:10:00 GMT</pubDate><guid>http://www.shnenglu.com/Leon916/archive/2008/10/27/65250.html</guid><wfw:comment>http://www.shnenglu.com/Leon916/comments/65250.html</wfw:comment><comments>http://www.shnenglu.com/Leon916/archive/2008/10/27/65250.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/Leon916/comments/commentRss/65250.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/Leon916/services/trackbacks/65250.html</trackback:ping><description><![CDATA[sizeof()功能Q计数据空间的字节?br>1.与strlen()比较<br>      strlen()计算字符数组的字W数Q以"\0"为结束判断?br>      而sizeof计算数据Q包括数l、变量、类型、结构体{)(j)所占内存空_(d)用字节数表示<br>2.指针与静(rn)态数l的sizeof操作<br>      指针均可看ؓ(f)变量cd的一U。所有指针变量的sizeof 操作l果均ؓ(f)4?br>      注意Qint *p; sizeof(p)=4;<br>                   但sizeof(*p)相当于sizeof(int);      <br>      对于?rn)态数l,sizeof可直接计数l大;<br>      例:(x)int a[10];char b[]="hello";<br>              sizeof(a){于10;<br>              sizeof(b){于7;<br>      注意Q数l做型参Ӟ数组名称当作指针使用Q!<br>               void  fun(char p[])<br>               {sizeof(p){于4}<br>    <br><span id="1161161" class=tpccontent1><font size=3><font face="Times New Roman"><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">  l典问题Q?/span> </font></font></span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana"><br><br><font size=3><font face="Times New Roman"><span id="1611116" class=tpccontent1>      double* (*a)[3][6];</span> <br><br></font></font><font size=3><font face="Times New Roman"><span id="6161661" class=tpccontent1>      cout<<sizeof(a)<<endl; // 4</span> <br><span id="1116166" class=tpccontent1>      cout<<sizeof(*a)<<endl; // 72</span> <br><span id="6161111" class=tpccontent1>      cout<<sizeof(**a)<<endl; // 24</span> <br><span id="1611661" class=tpccontent1>      cout<<sizeof(***a)<<endl; // 4</span> <br><span id="6661161" class=tpccontent1><span id="6161661" class=tpccontent1>      </span>cout<<sizeof(****a)<<endl; // 8</span> <br><br><span id="1161616" class=tpccontent1><span id="6611666" class=tpccontent1>      </span>a</span></font></font></span><font size=3><font face="Times New Roman"><span id="1616111" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">是一个很奇怪的定义Q他表示一个指?/span></span><span id="6616666" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">double*[3][6]</span></span><span id="1166161" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">cd数组的指针。既然是指针Q所?/span></span><span id="1616611" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">sizeof(a)</span></span><span id="6611616" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">是</span></span><span id="1661116" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">4</span></span><span id="6166111" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">?/span> </span></font></font><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana"><br><br><span id="1166111" class=tpccontent1><font face="Times New Roman" size=3><span id="6166661" class=tpccontent1>      </span></font></span></span><font size=3><font face="Times New Roman"><span id="1161666" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">既然</span></span><span id="6611666" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">a</span></span><span id="6611611" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">是执?/span></span><span id="6666611" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">double*[3][6]</span></span><span id="6661661" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">cd的指针,</span></span><span id="1161611" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">*a</span></span><span id="6661116" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">pCZ?/span></span><span id="6116611" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">double*[3][6]</span></span><span id="1666666" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">的多l数l类型,因此</span></span></font></font><font size=3><font face="Times New Roman"><span id="6111116" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">sizeof(*a)<br>     =3*6*sizeof(double*)=72</span></span><span id="6161161" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">。同L(fng)Q?/span></span><span id="1666616" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">**a</span></span><span id="6161166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">表示一?/span></span><span id="1111161" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">double*[6]</span></span><span id="6661161" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">cd的数l,所?/span></span><span id="6111161" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">sizeof(**a)=6*sizeof  (double*)=24</span></span><span id="6661166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">?/span></span><span id="6611666" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">***a</span></span><span id="6611116" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">pC其中的一个元素,也就?/span></span><span id="6661666" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">double*</span></span><span id="6111166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">?jin),所?/span></span><span id="6166666" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">sizeof(***a)=4</span></span><span id="6661611" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">。至?/span></span><span id="6611666" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">****a</span></span><span id="1116611" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q就是一?/span></span><span id="1111666" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">double</span></span><span id="6116616" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">?jin),所?/span></span><span id="1161616" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">sizeof(****a)=sizeof(double)=8</span></span></font></font><span id="1161611" class=tpccontent1><font size=3><font face="Times New Roman"><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">?/span> <br></font></font></span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana"><br><font face="Times New Roman" size=3>3.格式的写?br>   sizeof操作W,对变量或对象可以不加括号Q但若是cdQ须加括?br>4</font><font face="Times New Roman" size=3>.使用sizeof时string的注意事?br>   string s="hello";<br>   sizeof(s){于stringcȝ大小Qsizeof(s.c_str())得到的是与字W串长度?br>5.union 与struct的空间计?br>   M上遵循两个原则:(x)<br>   (1)整体I间?</font><span id="6116661" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana"><font face="Times New Roman" size=3>占用I间最大的成员Q的cdQ所占字节数的整倍数<br>   (2)数据寚w原则----内存按结构成员的 先后序排列Q当排到该成员变量时Q其前面已摆攄I间大小必须是该成员cd大小的整倍数Q如果不够则补齐Q以此向后类推。。。。?br>   注意Q数l按照单个变量一个一个的摆放Q而不是看成整体。如果成员(sh)有自定义的类、结构体Q也要注意数l问题?br>例:(x)[引用其他帖子的内容]<br><span id="1161111" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">因ؓ(f)寚w问题?sh)结构体?/span></span><span id="6661161" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">sizeof</span></span><span id="6161661" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">变得比较复杂Q看下面的例子:(x)</span></span><span id="1161666" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">(</span></span><span id="1161111" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">默认寚w方式?/span></span><span id="6166166" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">)</span></span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana"><br><br><span id="6616616" class=tpccontent1>struct s1</span><br><span id="6661116" class=tpccontent1>{</span><br><span id="1661611" class=tpccontent1>char a;</span><br><span id="1611111" class=tpccontent1>double b;</span><br><span id="6616611" class=tpccontent1>int c;</span><br><span id="6161111" class=tpccontent1>char d; </span><br><span id="1161616" class=tpccontent1>};</span><br><br><span id="6111661" class=tpccontent1>struct s2</span><br><span id="1666111" class=tpccontent1>{</span><br><span id="1166161" class=tpccontent1>char a;</span><br><span id="1666111" class=tpccontent1>char b;</span><br><span id="6666611" class=tpccontent1>int c;</span><br><span id="6116611" class=tpccontent1>double d;</span><br><span id="1166161" class=tpccontent1>};</span><br><br><span id="1611116" class=tpccontent1>cout<<sizeof(s1)<<endl; // 24</span><br><span id="6661616" class=tpccontent1>cout<<sizeof(s2)<<endl; // 16</span><br><br><span id="6666666" class=tpccontent1>  </span></span><span id="1166161" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">同样是两?/span></span><span id="1616111" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">char</span></span><span id="1616166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">cdQ一?/span></span><span id="6611666" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">int</span></span><span id="1661616" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">cdQ一?/span></span><span id="6666116" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">double</span></span><span id="6611111" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">cdQ但是因为对界问题,D他们的大不同。计结构体大小可以采用元素摆放法,我D例子说明一下:(x)首先Q?/span></span><span id="6161116" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">CPU</span></span><span id="1116611" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">判断l构体的对界Q根据上一节的l论Q?/span></span><span id="6616116" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">s1</span></span><span id="1116166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">?/span></span><span id="1661166" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">s2</span></span><span id="1616166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">的对界都取最大的元素cdQ也是</span></span><span id="6116611" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">double</span></span><span id="1666166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">cd的对?/span></span><span id="1111661" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">8</span></span><span id="1666611" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">。然后开始摆放每个元素?/span></span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana"><br><span id="6611166" class=tpccontent1>  </span></span><span id="6666166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">对于</span></span><span id="1161116" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">s1</span></span><span id="6116111" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q首先把</span></span><span id="6666161" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">a</span></span><span id="6611666" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">攑ֈ</span></span><span id="1111111" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">8</span></span><span id="1611166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">的对界,假定?/span></span><span id="6666666" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">0</span></span><span id="1611161" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q此时下一个空闲的地址?/span></span><span id="1116616" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">1</span></span><span id="6111666" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q但是下一个元?/span></span><span id="1666166" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">d</span></span><span id="6161611" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">?/span></span><span id="6116116" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">double</span></span><span id="1611161" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">cdQ要攑ֈ</span></span><span id="6616161" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">8</span></span><span id="6666661" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">的对界上Q离</span></span><span id="1661111" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">1</span></span><span id="1166666" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">最接近的地址?/span></span><span id="6166116" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">8</span></span><span id="6161611" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">?jin),所?/span></span><span id="1616166" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">d</span></span><span id="6666116" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">被放在了(jin)</span></span><span id="6166616" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">8</span></span><span id="6116161" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q此时下一个空闲地址变成?/span></span><span id="6616616" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">16</span></span><span id="1161161" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q下一个元?/span></span><span id="1661161" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">c</span></span><span id="6661161" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">的对界是</span></span><span id="1666661" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">4</span></span><span id="6161616" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q?/span></span><span id="1661666" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">16</span></span><span id="6616166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">可以满Q所?/span></span><span id="1616161" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">c</span></span><span id="6611166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">攑֜?/span></span><span id="1116111" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">16</span></span><span id="6616166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q此时下一个空闲地址变成?/span></span><span id="6611116" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">20</span></span><span id="6611666" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q下一个元?/span></span><span id="1166166" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">d</span></span><span id="1161611" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">需要对?/span></span><span id="6166116" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">1</span></span><span id="1661111" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q也正好落在对界上,所?/span></span><span id="1111111" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">d</span></span><span id="6611161" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">攑֜?/span></span><span id="6166111" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">20</span></span><span id="6111661" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q结构体在地址</span></span><span id="1611116" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">21</span></span><span id="1166611" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">处结束。由?/span></span><span id="1616116" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">s1</span></span><span id="1616611" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">的大需要是</span></span><span id="6616111" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">8</span></span><span id="6166616" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">的倍数Q所?/span></span><span id="6161666" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">21-23</span></span><span id="1661111" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">的空间被保留Q?/span></span><span id="1111116" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">s1</span></span><span id="1666116" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">的大变成了(jin)</span></span><span id="6166611" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">24</span></span><span id="1611611" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">?/span></span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana"><br><span id="6161166" class=tpccontent1>  </span></span><span id="1116116" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">对于</span></span><span id="1111661" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">s2</span></span><span id="1166616" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q首先把</span></span><span id="1616666" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">a</span></span><span id="1166116" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">攑ֈ</span></span><span id="1661611" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">8</span></span><span id="1611611" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">的对界,假定?/span></span><span id="1116166" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">0</span></span><span id="1611611" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q此时下一个空闲地址?/span></span><span id="6111161" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">1</span></span><span id="6166166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q下一个元素的对界也是</span></span><span id="6611616" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">1</span></span><span id="6611116" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q所?/span></span><span id="1111611" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">b</span></span><span id="6166161" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">摆放?/span></span><span id="1611111" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">1</span></span><span id="6616666" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q下一个空闲地址变成?/span></span><span id="1111166" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">2</span></span><span id="6166166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q下一个元?/span></span><span id="6611166" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">c</span></span><span id="1111666" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">的对界是</span></span><span id="1161111" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">4</span></span><span id="1111111" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q所以取?/span></span><span id="6661161" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">2</span></span><span id="6116666" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">最q的地址</span></span><span id="1116166" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">4</span></span><span id="6666111" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">摆放</span></span><span id="1111611" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">c</span></span><span id="6666111" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q下一个空闲地址变成?/span></span><span id="6611661" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">8</span></span><span id="1611661" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q下一个元?/span></span><span id="1166666" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">d</span></span><span id="1661611" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">的对界是</span></span><span id="1666616" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">8</span></span><span id="6166661" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q所?/span></span><span id="6616116" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">d</span></span><span id="1616161" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">摆放?/span></span><span id="6616611" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">8</span></span><span id="1161661" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q所有元素摆攑֮毕,l构体在</span></span><span id="1116611" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">15</span></span><span id="1116616" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">处结束,占用ȝ间ؓ(f)</span></span><span id="1116616" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">16</span></span><span id="6161166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q正好是</span></span><span id="6111661" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">8</span></span><span id="6611166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">的倍数?/span></span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana"><br><br><span id="1616111" class=tpccontent1>  </span></span><span id="6116661" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">q里有个陷阱Q对于结构体中的l构体成员,不要认ؓ(f)它的寚w方式是他的大小Q看下面的例子:(x)</span></span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana"><br><br><span id="1611666" class=tpccontent1>struct s1</span><br><span id="1666661" class=tpccontent1>{</span><br><span id="1611111" class=tpccontent1>char a[8];</span><br><span id="6611661" class=tpccontent1>};</span><br><br><span id="1161166" class=tpccontent1>struct s2</span><br><span id="1116161" class=tpccontent1>{</span><br><span id="6111666" class=tpccontent1>double d;</span><br><span id="1166616" class=tpccontent1>};</span><br><br><span id="1111116" class=tpccontent1>struct s3</span><br><span id="6111616" class=tpccontent1>{</span><br><span id="6661111" class=tpccontent1>s1 s;</span><br><span id="1666611" class=tpccontent1>char a;</span><br><span id="6116166" class=tpccontent1>};</span><br><br><span id="1666661" class=tpccontent1>struct s4</span><br><span id="1661161" class=tpccontent1>{</span><br><span id="1611116" class=tpccontent1>s2 s;</span><br><span id="1666116" class=tpccontent1>char a; </span><br><span id="1161611" class=tpccontent1>};</span><br><br><span id="1666116" class=tpccontent1>cout<<sizeof(s1)<<endl; // 8</span><br><span id="6161116" class=tpccontent1>cout<<sizeof(s2)<<endl; // 8</span><br><span id="6161616" class=tpccontent1>cout<<sizeof(s3)<<endl; // 9</span><br><span id="1166166" class=tpccontent1>cout<<sizeof(s4)<<endl; // 16;</span><br><br><span id="6611166" class=tpccontent1>  s1</span></span><span id="6161666" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">?/span></span><span id="1161661" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">s2</span></span><span id="1116116" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">大小虽然都是</span></span><span id="1166116" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">8</span></span><span id="1111611" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q但?/span></span><span id="6661166" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">s1</span></span><span id="1116666" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">的对齐方式是</span></span><span id="6116116" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">1</span></span><span id="6111166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q?/span></span><span id="1611661" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">s2</span></span><span id="1616111" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">?/span></span><span id="1116666" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">8</span></span><span id="6116611" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q?/span></span><span id="1116661" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">double</span></span><span id="1611666" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">Q,所以在</span></span><span id="6666666" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">s3</span></span><span id="1111166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">?/span></span><span id="1166661" class=tpccontent1><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">s4</span></span><span id="1661666" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">中才有这L(fng)差异?/span></span><span lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana"><br><br><span id="6166666" class=tpccontent1>  </span></span><span id="1661166" class=tpccontent1><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: ?hu)? mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">所以,在自己定义结构体的时候,如果I间紧张的话Q最好考虑寚w因素来排列结构体里的元素?/span></span></font></span></span></span> <img src ="http://www.shnenglu.com/Leon916/aggbug/65250.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/Leon916/" target="_blank">Leon916</a> 2008-10-27 22:10 <a href="http://www.shnenglu.com/Leon916/archive/2008/10/27/65250.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>|上面试题疑?/title><link>http://www.shnenglu.com/Leon916/archive/2008/10/06/63320.html</link><dc:creator>Leon916</dc:creator><author>Leon916</author><pubDate>Mon, 06 Oct 2008 08:00:00 GMT</pubDate><guid>http://www.shnenglu.com/Leon916/archive/2008/10/06/63320.html</guid><wfw:comment>http://www.shnenglu.com/Leon916/comments/63320.html</wfw:comment><comments>http://www.shnenglu.com/Leon916/archive/2008/10/06/63320.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.shnenglu.com/Leon916/comments/commentRss/63320.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/Leon916/services/trackbacks/63320.html</trackback:ping><description><![CDATA[    快找工作?jin),从今天开始开始复?fn)C++{知识了(jin)。现在遇C(jin)几个奇怪的题目Q?br>   1? <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> CLS<br><img id=Codehighlighter1_10_98_Open_Image onclick="this.style.display='none'; Codehighlighter1_10_98_Open_Text.style.display='none'; Codehighlighter1_10_98_Closed_Image.style.display='inline'; Codehighlighter1_10_98_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_10_98_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_10_98_Closed_Text.style.display='none'; Codehighlighter1_10_98_Open_Image.style.display='inline'; Codehighlighter1_10_98_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_10_98_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_10_98_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">:<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> m_i;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    CLS( </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i ) </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">: m_i(i) {}</span><span style="COLOR: #008000"><br><img id=Codehighlighter1_59_73_Open_Image onclick="this.style.display='none'; Codehighlighter1_59_73_Open_Text.style.display='none'; Codehighlighter1_59_73_Closed_Image.style.display='inline'; Codehighlighter1_59_73_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_59_73_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_59_73_Closed_Text.style.display='none'; Codehighlighter1_59_73_Open_Image.style.display='inline'; Codehighlighter1_59_73_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span id=Codehighlighter1_59_73_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_59_73_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        m_i </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> i;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    CLS()<br><img id=Codehighlighter1_83_96_Open_Image onclick="this.style.display='none'; Codehighlighter1_83_96_Open_Text.style.display='none'; Codehighlighter1_83_96_Closed_Image.style.display='inline'; Codehighlighter1_83_96_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_83_96_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_83_96_Closed_Text.style.display='none'; Codehighlighter1_83_96_Open_Image.style.display='inline'; Codehighlighter1_83_96_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span id=Codehighlighter1_83_96_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_83_96_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        CLS(</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">);<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main()<br><img id=Codehighlighter1_112_150_Open_Image onclick="this.style.display='none'; Codehighlighter1_112_150_Open_Text.style.display='none'; Codehighlighter1_112_150_Closed_Image.style.display='inline'; Codehighlighter1_112_150_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_112_150_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_112_150_Closed_Text.style.display='none'; Codehighlighter1_112_150_Open_Image.style.display='inline'; Codehighlighter1_112_150_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_112_150_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_112_150_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    CLS obj;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> obj.m_i </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span></div> 问输出是多少Q?br>调试之后Q发现在<br>CLS()<br> {<br>  CLS(0);<br> }<br>中的this指针不同Q所以这里可能和c#或者Java不同Q当调用CLSQ?Q的时候,它会(x)重新分配一块空_(d)q且初始化新对象的m_i=0.<br>后来在网上搜?jin)一下,找打?jin)这文章?x)<a >http://blog.csdn.net/cnheying/archive/2007/05/16/1611698.aspx</a> ?a >http://www.cnblogs.com/chio/archive/2007/10/20/931043.html</a>。不知道大家对这道题有什么想法,Ƣ迎讨论Q?br>2? <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #0000ff">float</span><span style="COLOR: #000000"> a </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>    cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">)a </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>    cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">)a </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">cout << *(int*)&a << endl;</span><span style="COLOR: #008000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">    cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> boolalpha </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> ((</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">)a </span><span style="COLOR: #000000">==</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">)a) </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>    </span><span style="COLOR: #0000ff">float</span><span style="COLOR: #000000"> b </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0.0f</span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>    cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">)b </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>    cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">)b </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>    cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> boolalpha </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> ((</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">)b </span><span style="COLOR: #000000">==</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">)b) </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>    cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;</span></div> 本来不存在我注释的那一行,考虑Qint&)a的时候,发现输出跟想想的不一P后来发现?(int*)&a的值是相同的。所以我猜测(int&)a可能首先取a的地址Q然后{化成(int*)Q再去a地址里面的内容,q时是按照intd的?br>3? <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> x </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">p </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">x;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> y </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>    cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> (</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">p) </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000"> y </span><span style="COLOR: #000000">?</span><span style="COLOR: #000000"> (</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">p)</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">: y) </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>    cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> x </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;</span></div>  关于三元q算W和++的比较,++的优先比三元运符高。我是在VS2005下调试的Q通过L~代码,发现((*p) ++< y ? (*p)++: y)Q首先对x+1Q然后把值回写的内存?sh),用原来的之比较,比较晚之后,再从内存(sh)读取出|q行cout<<Q?pQ?+<<endl;的操作。输出原值后?1。结果x最l输?。(q样如果L语言Q我觉得自己?x)死人的Q?br>      如果以上哪里分析的不对,Ƣ迎大家拍砖Q! <img src ="http://www.shnenglu.com/Leon916/aggbug/63320.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/Leon916/" target="_blank">Leon916</a> 2008-10-06 16:00 <a href="http://www.shnenglu.com/Leon916/archive/2008/10/06/63320.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>лǵվܻԴȤ</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.xxysw.com.cn" target="_blank">޹Ʒþһ</a>| <a href="http://www.scjyzj.cn" target="_blank">պ뾫Ʒþþò</a>| <a href="http://www.secwatch.com.cn" target="_blank">ɫۺϾþ</a>| <a href="http://www.hedv.com.cn" target="_blank">þþþþ</a>| <a href="http://www.leftbank-cn.cn" target="_blank">þһ</a>| <a href="http://www.ssjnet.cn" target="_blank">99Ʒþþþþþ</a>| <a href="http://www.gdfw.org.cn" target="_blank">ݺۺϾþۺ88</a>| <a href="http://www.kinhi.cn" target="_blank">þþžžƷ99Ʒ</a>| <a href="http://www.thenorthface.net.cn" target="_blank">þۺϸۺϾþ</a>| <a href="http://www.taiguolu.com.cn" target="_blank">þþƷѹۿ</a>| <a href="http://www.jywxhs.cn" target="_blank">ۺϾþĻӰ </a>| <a href="http://www.panxl.cn" target="_blank">Ʒ޾þþþþ</a>| <a href="http://www.qq-info.cn" target="_blank">re99þ6Ʒ</a>| <a href="http://www.lvyoubuy.cn" target="_blank">޹˾Ʒ91þþ </a>| <a href="http://www.b3804.cn" target="_blank">þܳ</a>| <a href="http://www.110xi.cn" target="_blank">þúݺݸ߳޾Ʒ</a>| <a href="http://www.cd-hk.cn" target="_blank">þŷ޹ۺ</a>| <a href="http://www.ckpic.com.cn" target="_blank">þþþĻƷ</a>| <a href="http://www.dpww.net.cn" target="_blank">ɫվþþþۺywww</a>| <a href="http://www.clkj168.cn" target="_blank">þAV뾫Ʒɫҹ鶹</a>| <a href="http://www.shishangxie.cn" target="_blank">߳߳þþ91</a>| <a href="http://www.gzmxjc.cn" target="_blank">˾ƷþѶ </a>| <a href="http://www.songshuidaojia.cn" target="_blank">Ʒ99þþþ91gav </a>| <a href="http://www.tb901.cn" target="_blank">ٸþĻ</a>| <a href="http://www.tongshuntaoci.cn" target="_blank">þþƷĻ</a>| <a href="http://www.hbjboke.cn" target="_blank">þþƷһպ</a>| <a href="http://www.33k4.cn" target="_blank">ɫۺɫþû</a>| <a href="http://www.epfb.cn" target="_blank">Ʒþ99</a>| <a href="http://www.dqcz.net.cn" target="_blank">Ʒþþþþþ</a>| <a href="http://www.myth9.cn" target="_blank">ŷvaþþþ</a>| <a href="http://www.njyy888.com.cn" target="_blank">һ97ձ˾þۺӰԺ</a>| <a href="http://www.ycsxw.cn" target="_blank">һƷþð͹</a>| <a href="http://www.chiti.com.cn" target="_blank">þþþƷ</a>| <a href="http://www.enliangjiancai.cn" target="_blank">99ȳ˾ƷȾþ669</a>| <a href="http://www.chaigan.cn" target="_blank">þ޾ƷAVӣ</a>| <a href="http://www.51hitjj.cn" target="_blank">޾ƷҹVAþó</a>| <a href="http://www.bamboomart.cn" target="_blank">þþþþþþ66ƷƬ</a>| <a href="http://www.aikandianying.cn" target="_blank">ۺϾþһ</a>| <a href="http://www.18xh.cn" target="_blank">һɫþ88ۺպƷ</a>| <a href="http://www.z5621.cn" target="_blank">˾þۺij</a>| <a href="http://www.shairproperty.cn" target="_blank">ŷþþþþҹƷ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>