﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-Lost Memory</title><link>http://www.cppblog.com/pamilty/</link><description>Programming is an art, then be an artist.</description><language>zh-cn</language><lastBuildDate>Mon, 13 Apr 2026 09:37:41 GMT</lastBuildDate><pubDate>Mon, 13 Apr 2026 09:37:41 GMT</pubDate><ttl>60</ttl><item><title>Visual Studio 中 C++ 程序 Memory Leak 的检测</title><link>http://www.cppblog.com/pamilty/archive/2015/03/07/209953.html</link><dc:creator>pamilty</dc:creator><author>pamilty</author><pubDate>Sat, 07 Mar 2015 09:11:00 GMT</pubDate><guid>http://www.cppblog.com/pamilty/archive/2015/03/07/209953.html</guid><wfw:comment>http://www.cppblog.com/pamilty/comments/209953.html</wfw:comment><comments>http://www.cppblog.com/pamilty/archive/2015/03/07/209953.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/pamilty/comments/commentRss/209953.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/pamilty/services/trackbacks/209953.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;&nbsp;<a href='http://www.cppblog.com/pamilty/archive/2015/03/07/209953.html'>阅读全文</a><img src ="http://www.cppblog.com/pamilty/aggbug/209953.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/pamilty/" target="_blank">pamilty</a> 2015-03-07 17:11 <a href="http://www.cppblog.com/pamilty/archive/2015/03/07/209953.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Float Number Comparison</title><link>http://www.cppblog.com/pamilty/archive/2014/01/20/205489.html</link><dc:creator>pamilty</dc:creator><author>pamilty</author><pubDate>Mon, 20 Jan 2014 03:47:00 GMT</pubDate><guid>http://www.cppblog.com/pamilty/archive/2014/01/20/205489.html</guid><wfw:comment>http://www.cppblog.com/pamilty/comments/205489.html</wfw:comment><comments>http://www.cppblog.com/pamilty/archive/2014/01/20/205489.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/pamilty/comments/commentRss/205489.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/pamilty/services/trackbacks/205489.html</trackback:ping><description><![CDATA[reference link --- <a href="http://floating-point-gui.de/errors/comparison/" target="_blank">[Comparison : http://floating-point-gui.de/errors/comparison/]</a>&nbsp;<br /><br /><span style="font-family: Helvetica, Arial, sans-serif; font-size: 10px; line-height: 20px; text-align: center; background-color: #ffffee;">under the&nbsp;</span><a href="http://creativecommons.org/licenses/by/3.0/" style="font-family: Helvetica, Arial, sans-serif; font-size: 10px; line-height: 20px; text-align: center; background-color: #ffffee;">Creative Commons Attribution License (BY)</a><br /><h1>Comparison</h1><p style="font-family: Helvetica, Arial, sans-serif; margin: 20px 0px; font-size: 15px; line-height: 20px; background-color: #ffffee;">Due to rounding errors, most&nbsp;<a href="http://floating-point-gui.de/formats/fp/">floating-point</a>&nbsp;numbers end up being slightly imprecise. As long as this imprecision stays small, it can usually be ignored. However, it also means that numbers expected to be equal (e.g. when calculating the same result through different correct methods) often differ slightly, and a simple equality test fails. For example:</p><pre style="font-family: Courier, serif; font-size: medium; line-height: normal; background-color: #ffffee;"><code style="font-family: Courier, serif;">	float a = 0.15 + 0.15 	float b = 0.1 + 0.2 	if(a == b) // can be false! 	if(a &gt;= b) // can also be false! </code></pre><h2>Don&#8217;t use absolute error margins</h2><p style="font-family: Helvetica, Arial, sans-serif; margin: 20px 0px; font-size: 15px; line-height: 20px; background-color: #ffffee;">The solution is to check not whether the numbers are exactly the same, but whether their difference is very small. The error margin that the difference is compared to is often called&nbsp;<em>epsilon</em>. The most simple form:</p><pre style="font-family: Courier, serif; font-size: medium; line-height: normal; background-color: #ffffee;"><code style="font-family: Courier, serif;">	if( Math.abs(a-b) &lt; 0.00001) // wrong - don't do this </code></pre><p style="font-family: Helvetica, Arial, sans-serif; margin: 20px 0px; font-size: 15px; line-height: 20px; background-color: #ffffee;">This is a bad way to do it because a fixed epsilon chosen because it &#8220;looks small&#8221; could actually be way too large when the numbers being compared are very small as well. The comparison would return &#8220;true&#8221; for numbers that are quite different. And when the numbers are very large, the epsilon could end up being smaller than the smallest rounding error, so that the comparison always returns &#8220;false&#8221;. Therefore, it is necessary to see whether the&nbsp;<em>relative error</em>&nbsp;is smaller than epsilon:</p><pre style="font-family: Courier, serif; font-size: medium; line-height: normal; background-color: #ffffee;"><code style="font-family: Courier, serif;">	if( Math.abs((a-b)/b) &lt; 0.00001 ) // still not right! </code></pre><h2>Look out for edge cases</h2><p style="font-family: Helvetica, Arial, sans-serif; margin: 20px 0px; font-size: 15px; line-height: 20px; background-color: #ffffee;">There are some important special cases where this will fail:</p><ul style="font-family: Helvetica, Arial, sans-serif; font-size: medium; line-height: normal; background-color: #ffffee;"><li style="list-style-type: square; font-size: 15px; line-height: 20px;">When both&nbsp;<code style="font-family: Courier, serif;">a</code>&nbsp;and&nbsp;<code style="font-family: Courier, serif;">b</code>&nbsp;are zero.&nbsp;<code style="font-family: Courier, serif;">0.0/0.0</code>&nbsp;is &#8220;not a number&#8221;, which causes an exception on some platforms, or returns false for all comparisons.</li><li style="list-style-type: square; font-size: 15px; line-height: 20px;">When only&nbsp;<code style="font-family: Courier, serif;">b</code>&nbsp;is zero, the division yields &#8220;infinity&#8221;, which may also cause an exception, or is greater than epsilon even when&nbsp;<code style="font-family: Courier, serif;">a</code>&nbsp;is smaller.</li><li style="list-style-type: square; font-size: 15px; line-height: 20px;">It returns&nbsp;<code style="font-family: Courier, serif;">false</code>&nbsp;when both&nbsp;<code style="font-family: Courier, serif;">a</code>&nbsp;and&nbsp;<code style="font-family: Courier, serif;">b</code>&nbsp;are very small but on opposite sides of zero, even when they&#8217;re the smallest possible non-zero numbers.</li></ul><p style="font-family: Helvetica, Arial, sans-serif; margin: 20px 0px; font-size: 15px; line-height: 20px; background-color: #ffffee;">Also, the result is not commutative (<code style="font-family: Courier, serif;">nearlyEquals(a,b)</code>&nbsp;is not always the same as&nbsp;<code style="font-family: Courier, serif;">nearlyEquals(b,a)</code>). To fix these problems, the code has to get a lot more complex, so we really need to put it into a function of its own:</p><pre style="font-family: Courier, serif; font-size: medium; line-height: normal; background-color: #ffffee;"><code style="font-family: Courier, serif;">	public static boolean nearlyEqual(float a, float b, float epsilon) { 		final float absA = Math.abs(a); 		final float absB = Math.abs(b); 		final float diff = Math.abs(a - b);  		if (a == b) { // shortcut, handles infinities 			return true; 		} else if (a == 0 || b == 0 || diff &lt; Float.MIN_NORMAL) { 			// a or b is zero or both are extremely close to it 			// relative error is less meaningful here 			return diff &lt; (epsilon * Float.MIN_NORMAL); 		} else { // use relative error 			return diff / (absA + absB) &lt; epsilon; 		} 	} </code></pre><p style="font-family: Helvetica, Arial, sans-serif; margin: 20px 0px; font-size: 15px; line-height: 20px; background-color: #ffffee;">This method&nbsp;<a href="http://floating-point-gui.de/errors/NearlyEqualsTest.java">passes tests</a>&nbsp;for many important special cases, but as you can see, it uses some quite non-obvious logic. In particular, it has to use a completely different definition of error margin when&nbsp;<code style="font-family: Courier, serif;">a</code>&nbsp;or&nbsp;<code style="font-family: Courier, serif;">b</code>&nbsp;is zero, because the classical definition of relative error becomes meaningless in those cases.</p><p style="font-family: Helvetica, Arial, sans-serif; margin: 20px 0px; font-size: 15px; line-height: 20px; background-color: #ffffee;">There are some cases where the method above still produces unexpected results (in particular, it&#8217;s much stricter when one value is nearly zero than when it is exactly zero), and some of the tests it was developed to pass probably specify behaviour that is not appropriate for some applications. Before using it, make sure it&#8217;s appropriate for your application!</p><h2>Comparing floating-point values as integers</h2><p style="font-family: Helvetica, Arial, sans-serif; margin: 20px 0px; font-size: 15px; line-height: 20px; background-color: #ffffee;">There is an alternative to heaping conceptual complexity onto such an apparently simple task: instead of comparing&nbsp;<code style="font-family: Courier, serif;">a</code>and&nbsp;<code style="font-family: Courier, serif;">b</code>&nbsp;as&nbsp;<a href="http://en.wikipedia.org/wiki/Real_numbers">real numbers</a>, we can think about them as discrete steps and define the error margin as the maximum number of possible floating-point values between the two values.</p><p style="font-family: Helvetica, Arial, sans-serif; margin: 20px 0px; font-size: 15px; line-height: 20px; background-color: #ffffee;">This is conceptually very clear and easy and has the advantage of implicitly scaling the relative error margin with the magnitude of the values. Technically, it&#8217;s a bit more complex, but not as much as you might think, because IEEE 754 floats are designed to maintain their order when their bit patterns are interpreted as integers.</p><p style="font-family: Helvetica, Arial, sans-serif; margin: 20px 0px; font-size: 15px; line-height: 20px; background-color: #ffffee;">However, this method does require the programming language to support conversion between floating-point values and integer bit patterns. Read the&nbsp;<a href="http://floating-point-gui.de/references/">Comparing floating-point numbers</a>&nbsp;paper for more details.</p><br /><br /><br /><br /><img src ="http://www.cppblog.com/pamilty/aggbug/205489.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/pamilty/" target="_blank">pamilty</a> 2014-01-20 11:47 <a href="http://www.cppblog.com/pamilty/archive/2014/01/20/205489.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何设置 Ubuntu 12.04，使得可以以其他用户(包括root)来登陆</title><link>http://www.cppblog.com/pamilty/archive/2013/07/15/201809.html</link><dc:creator>pamilty</dc:creator><author>pamilty</author><pubDate>Mon, 15 Jul 2013 05:13:00 GMT</pubDate><guid>http://www.cppblog.com/pamilty/archive/2013/07/15/201809.html</guid><wfw:comment>http://www.cppblog.com/pamilty/comments/201809.html</wfw:comment><comments>http://www.cppblog.com/pamilty/archive/2013/07/15/201809.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/pamilty/comments/commentRss/201809.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/pamilty/services/trackbacks/201809.html</trackback:ping><description><![CDATA[&nbsp; *<br />open Terminal and type the following command:<br /><br />$sudo sh -c 'echo "greeter-show-manual-login=true" &gt;&gt; /etc/lightdm/lightdm.conf'<br /><br />restart computer and choose to login as the desired user.<br /><br />reference link: Liberian Geek <a href="http://www.liberiangeek.net/2012/05/login-as-root-in-ubuntu-12-04-precise-pangolin/">Login as Root in Ubuntu 12.04 (Precise Pangolin)</a><img src ="http://www.cppblog.com/pamilty/aggbug/201809.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/pamilty/" target="_blank">pamilty</a> 2013-07-15 13:13 <a href="http://www.cppblog.com/pamilty/archive/2013/07/15/201809.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何设置开启 Ubuntu 12.04 的 root 账户及设置对应密码</title><link>http://www.cppblog.com/pamilty/archive/2013/07/15/201807.html</link><dc:creator>pamilty</dc:creator><author>pamilty</author><pubDate>Mon, 15 Jul 2013 03:40:00 GMT</pubDate><guid>http://www.cppblog.com/pamilty/archive/2013/07/15/201807.html</guid><wfw:comment>http://www.cppblog.com/pamilty/comments/201807.html</wfw:comment><comments>http://www.cppblog.com/pamilty/archive/2013/07/15/201807.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/pamilty/comments/commentRss/201807.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/pamilty/services/trackbacks/201807.html</trackback:ping><description><![CDATA[<br />1) First <br />enable the root account by running the commands below:<br />$ sudo passwd -u root<br />When prompted for password, enter your personal password to continue.<br />2) Then <br />reset/add the root password by running the commands below:<br />$sudo passwd root<br />When you run the commands above, you'll get prompted to enter a new password.<br /><br />reference link:&nbsp; Liberian Geek <a href="http://www.liberiangeek.net/2012/07/question-what-is-the-root-default-password-in-ubuntu-12-04/">[Question] What is the Root Default Password in Ubuntu 12.04?</a><img src ="http://www.cppblog.com/pamilty/aggbug/201807.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/pamilty/" target="_blank">pamilty</a> 2013-07-15 11:40 <a href="http://www.cppblog.com/pamilty/archive/2013/07/15/201807.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>C C++ Operator precedence</title><link>http://www.cppblog.com/pamilty/archive/2013/05/02/199900.html</link><dc:creator>pamilty</dc:creator><author>pamilty</author><pubDate>Thu, 02 May 2013 05:06:00 GMT</pubDate><guid>http://www.cppblog.com/pamilty/archive/2013/05/02/199900.html</guid><wfw:comment>http://www.cppblog.com/pamilty/comments/199900.html</wfw:comment><comments>http://www.cppblog.com/pamilty/archive/2013/05/02/199900.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/pamilty/comments/commentRss/199900.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/pamilty/services/trackbacks/199900.html</trackback:ping><description><![CDATA[<div>
<table>
     <tbody>
         <tr>
             <th style="border-style: solid">Precedence</th> <th style="border-style: solid">Operator</th> <th style="border-style: solid">Description</th> <th style="border-style: solid">Associativity</th>
         </tr>
         <tr>
             <th style="border-style: solid">1
             <p><small>highest</small></p>
             </th>
             <td style="border-style: solid"><code>::</code></td>
             <td style="border-style: solid">Scope resolution (C++ only)</td>
             <td style="border-style: solid">None</td>
         </tr>
         <tr>
             <th style="border-style: solid" rowspan="11">2</th>
             <td style="border-style: solid"><code>++</code></td>
             <td style="border-style: solid">Suffix increment</td>
             <td style="vertical-align: top; border-style: solid" rowspan="11">Left-to-right</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>--</code></td>
             <td style="border-style: solid">Suffix decrement</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>()</code></td>
             <td style="border-style: solid">Function call</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>[]</code></td>
             <td style="border-style: solid">Array subscripting</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>.</code></td>
             <td style="border-style: solid">Element selection by reference</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>-&gt;</code></td>
             <td style="border-style: solid">Element selection through pointer</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>typeid()</code></td>
             <td style="border-style: solid"><a href="http://en.wikipedia.org/wiki/Run-time_type_information" title="Run-time type information">Run-time type information</a> (C++ only) (see <a href="http://en.wikipedia.org/wiki/Typeid" title="Typeid">typeid</a>)</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>const_cast</code></td>
             <td style="border-style: solid">Type cast (C++ only) (see <a href="http://en.wikipedia.org/wiki/Const_cast" title="Const cast">const_cast</a>)</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>dynamic_cast</code></td>
             <td style="border-style: solid">Type cast (C++ only) (see <a href="http://en.wikipedia.org/wiki/Dynamic_cast" title="Dynamic cast">dynamic_cast</a>)</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>reinterpret_cast</code></td>
             <td style="border-style: solid">Type cast (C++ only) (see <a href="http://en.wikipedia.org/wiki/Reinterpret_cast" title="Reinterpret cast">reinterpret_cast</a>)</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>static_cast</code></td>
             <td style="border-style: solid">Type cast (C++ only) (see <a href="http://en.wikipedia.org/wiki/Static_cast" title="Static cast">static_cast</a>)</td>
         </tr>
         <tr>
             <th style="border-style: solid" rowspan="12">3</th>
             <td style="border-style: solid"><code>++</code></td>
             <td style="border-style: solid">Prefix increment</td>
             <td style="vertical-align: top; border-style: solid" rowspan="12">Right-to-left</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>--</code></td>
             <td style="border-style: solid">Prefix decrement</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>+</code></td>
             <td style="border-style: solid">Unary plus</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>-</code></td>
             <td style="border-style: solid">Unary minus</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>!</code></td>
             <td style="border-style: solid">Logical NOT</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>~</code></td>
             <td style="border-style: solid">Bitwise NOT (One's Complement)</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>(<em>type</em>)</code></td>
             <td style="border-style: solid">Type cast</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>*</code></td>
             <td style="border-style: solid">Indirection (dereference)</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>&amp;</code></td>
             <td style="border-style: solid">Address-of</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>sizeof</code></td>
             <td style="border-style: solid"><a href="http://en.wikipedia.org/wiki/Sizeof" title="Sizeof">Size-of</a></td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>new</code>, <code>new[]</code></td>
             <td style="border-style: solid">Dynamic memory allocation (C++ only)</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>delete</code>, <code>delete[]</code></td>
             <td style="border-style: solid">Dynamic memory deallocation (C++ only)</td>
         </tr>
         <tr>
             <th style="border-style: solid" rowspan="2">4</th>
             <td style="border-style: solid"><code>.*</code></td>
             <td style="border-style: solid">Pointer to member (C++ only)</td>
             <td style="vertical-align: top; border-style:solid" rowspan="2">Left-to-right</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>-&gt;*</code></td>
             <td style="border-style: solid">Pointer to member (C++ only)</td>
         </tr>
         <tr>
             <th style="border-style: solid" rowspan="3">5</th>
             <td style="border-style: solid"><code>*</code></td>
             <td style="border-style: solid">Multiplication</td>
             <td style="vertical-align: top; border-style:solid" rowspan="3">Left-to-right</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>/</code></td>
             <td style="border-style: solid">Division</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>%</code></td>
             <td style="border-style: solid"><a href="http://en.wikipedia.org/wiki/Modulo_operation" title="Modulo operation">Modulo</a> (remainder)</td>
         </tr>
         <tr>
             <th style="border-style: solid" rowspan="2">6</th>
             <td style="border-style: solid"><code>+</code></td>
             <td style="border-style: solid">Addition</td>
             <td style="vertical-align: top;border-style:solid" rowspan="2">Left-to-right</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>-</code></td>
             <td style="border-style: solid">Subtraction</td>
         </tr>
         <tr>
             <th style="border-style: solid" rowspan="2">7</th>
             <td style="border-style: solid"><code>&lt;&lt;</code></td>
             <td style="border-style: solid"><a href="http://en.wikipedia.org/wiki/Bitwise_operation" title="Bitwise operation">Bitwise</a> left shift</td>
             <td style="vertical-align: top;border-style:solid" rowspan="2">Left-to-right</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>&gt;&gt;</code></td>
             <td style="border-style: solid"><a href="http://en.wikipedia.org/wiki/Bitwise_operation" title="Bitwise operation">Bitwise</a> right shift</td>
         </tr>
         <tr>
             <th style="border-style: solid" rowspan="4">8</th>
             <td style="border-style: solid"><code>&lt;</code></td>
             <td style="border-style: solid">Less than</td>
             <td style="vertical-align: top;border-style:solid" rowspan="4">Left-to-right</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>&lt;=</code></td>
             <td style="border-style: solid">Less than or equal to</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>&gt;</code></td>
             <td style="border-style: solid">Greater than</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>&gt;=</code></td>
             <td style="border-style: solid">Greater than or equal to</td>
         </tr>
         <tr>
             <th style="border-style: solid" rowspan="2">9</th>
             <td style="border-style: solid"><code>==</code></td>
             <td style="border-style: solid">Equal to</td>
             <td style="vertical-align: top;border-style:solid" rowspan="2">Left-to-right</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>!=</code></td>
             <td style="border-style: solid">Not equal to</td>
         </tr>
         <tr>
             <th style="border-style: solid">10</th>
             <td style="border-style: solid"><code>&amp;</code></td>
             <td style="border-style: solid">Bitwise AND</td>
             <td style="border-style: solid">Left-to-right</td>
         </tr>
         <tr>
             <th style="border-style: solid">11</th>
             <td style="border-style: solid"><code>^</code></td>
             <td style="border-style: solid">Bitwise XOR (exclusive or)</td>
             <td style="border-style: solid">Left-to-right</td>
         </tr>
         <tr>
             <th style="border-style: solid">12</th>
             <td style="border-style: solid"><code>|</code></td>
             <td style="border-style: solid">Bitwise OR (inclusive or)</td>
             <td style="border-style: solid">Left-to-right</td>
         </tr>
         <tr>
             <th style="border-style: solid">13</th>
             <td style="border-style: solid"><code>&amp;&amp;</code></td>
             <td style="border-style: solid">Logical AND</td>
             <td style="border-style: solid">Left-to-right</td>
         </tr>
         <tr>
             <th style="border-style: solid">14</th>
             <td style="border-style: solid"><code>||</code></td>
             <td style="border-style: solid">Logical OR</td>
             <td style="border-style: solid">Left-to-right</td>
         </tr>
         <tr>
             <th style="border-style: solid">15</th>
             <td style="border-style: solid"><code>?:</code></td>
             <td style="border-style: solid"><a href="http://en.wikipedia.org/wiki/Ternary_operator" title="Ternary operator">Ternary</a> conditional (see <a href="http://en.wikipedia.org/wiki/%3F:" title="?:">?:</a>)</td>
             <td style="border-style: solid">Right-to-left</td>
         </tr>
         <tr>
             <th style="border-style: solid" rowspan="11">16</th>
             <td style="border-style: solid"><code>=</code></td>
             <td style="border-style: solid">Direct assignment</td>
             <td style="vertical-align: top;border-style:solid" rowspan="11">Right-to-left</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>+=</code></td>
             <td style="border-style: solid">Assignment by sum</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>-=</code></td>
             <td style="border-style: solid">Assignment by difference</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>*=</code></td>
             <td style="border-style: solid">Assignment by product</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>/=</code></td>
             <td style="border-style: solid">Assignment by quotient</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>%=</code></td>
             <td style="border-style: solid">Assignment by remainder</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>&lt;&lt;=</code></td>
             <td style="border-style: solid">Assignment by bitwise left shift</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>&gt;&gt;=</code></td>
             <td style="border-style: solid">Assignment by bitwise right shift</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>&amp;=</code></td>
             <td style="border-style: solid">Assignment by bitwise AND</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>^=</code></td>
             <td style="border-style: solid">Assignment by bitwise XOR</td>
         </tr>
         <tr>
             <td style="border-style: solid"><code>|=</code></td>
             <td style="border-style: solid">Assignment by bitwise OR</td>
         </tr>
         <tr>
             <th style="border-style: solid">17</th>
             <td style="border-style: solid"><code>throw</code></td>
             <td style="border-style: solid">Throw operator (exceptions throwing, C++ only)</td>
             <td style="border-style: solid">Right-to-left</td>
         </tr>
         <tr>
             <th style="border-style: solid">18
             <p><small>lowest</small></p>
             </th>
             <td style="border-style: solid"><code>,</code></td>
             <td style="border-style: solid"><a href="http://en.wikipedia.org/wiki/Comma_operator" title="Comma operator">Comma</a></td>
             <td style="border-style: solid">Left-to-right</td>
         </tr>
     </tbody>
</table>
</div>
<br />
reference url: <a href="http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B">http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B </a>
<img src ="http://www.cppblog.com/pamilty/aggbug/199900.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/pamilty/" target="_blank">pamilty</a> 2013-05-02 13:06 <a href="http://www.cppblog.com/pamilty/archive/2013/05/02/199900.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ASCII 码表，及 Unicode字符UTF-8编码查询</title><link>http://www.cppblog.com/pamilty/archive/2013/02/23/198038.html</link><dc:creator>pamilty</dc:creator><author>pamilty</author><pubDate>Sat, 23 Feb 2013 14:32:00 GMT</pubDate><guid>http://www.cppblog.com/pamilty/archive/2013/02/23/198038.html</guid><wfw:comment>http://www.cppblog.com/pamilty/comments/198038.html</wfw:comment><comments>http://www.cppblog.com/pamilty/archive/2013/02/23/198038.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/pamilty/comments/commentRss/198038.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/pamilty/services/trackbacks/198038.html</trackback:ping><description><![CDATA[Unicode 值对应的 UTF-8 编码查询地址：<a href="http://www.utf8-chartable.de/ ">http://www.utf8-chartable.de/</a><br />ASCII 码表，及扩展表内容如下：<br /><img alt="" src="http://www.cppblog.com/images/cppblog_com/pamilty/asciifull.gif" height="488" width="715" /><br />Extended ASCII table<br /><img alt="" src="http://www.cppblog.com/images/cppblog_com/pamilty/extend.gif" height="335" width="573" /><img src ="http://www.cppblog.com/pamilty/aggbug/198038.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/pamilty/" target="_blank">pamilty</a> 2013-02-23 22:32 <a href="http://www.cppblog.com/pamilty/archive/2013/02/23/198038.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>