<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>programming &amp;mdash; Little Step</title>
    <link>https://rex.writeas.com/tag:programming</link>
    <description></description>
    <pubDate>Sun, 10 May 2026 00:29:52 +0000</pubDate>
    <item>
      <title>C++ alternative operators</title>
      <link>https://rex.writeas.com/c-alternative-operators?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[As a C++ programmer for many years, I never noticed the other style of logic operators in C++ until today.&#xA;&#xA;When I review part of code witten by one of my colleague which is a mainly a Java programmer, and find he uses and other than &amp;&amp; in if statement.&#xA;&#xA;And I check cppreference, and find the C++ operator alternative.&#xA;&#xA;| Primary      | Alternative |&#xA;|------------ |----------- |&#xA;| &amp;&amp;           | and         |&#xA;| &amp;=           | and\eq     |&#xA;| &amp;            | bitand      |&#xA;| &amp;vert;       | bitor       |&#xA;| ~            | compl       |&#xA;| !            | not         |&#xA;| !=           | not\eq     |&#xA;| &amp;vert;&amp;vert; | or          |&#xA;| &amp;vert;=      | or\eq      |&#xA;| ^            | xor         |&#xA;| ^=           | xor\_eq     |&#xA;| {            | &lt;%          |&#xA;| }            | %  |&#xA;| [            | &lt;:          |&#xA;| ]            | :  |&#xA;| #            | %:          |&#xA;| ##           | %:%:        |&#xA;&#xA;The reason for alternative operators is that the source code maybe not in ASCII set, and don&#39;t have the proper operators.&#xA;&#xA;\#cpp #programming #operator]]&gt;</description>
      <content:encoded><![CDATA[<p>As a C++ programmer for many years, I never noticed the other style of logic operators in C++ until today.</p>

<p>When I review part of code witten by one of my colleague which is a mainly a Java programmer, and find he uses <strong>and</strong> other than <strong>&amp;&amp;</strong> in if statement.</p>

<p>And I check cppreference, and find the <a href="https://en.cppreference.com/w/cpp/language/operator_alternative" rel="nofollow">C++ operator alternative</a>.</p>

<table>
<thead>
<tr>
<th>Primary</th>
<th>Alternative</th>
</tr>
</thead>

<tbody>
<tr>
<td>&amp;&amp;</td>
<td>and</td>
</tr>

<tr>
<td>&amp;=</td>
<td>and_eq</td>
</tr>

<tr>
<td>&amp;</td>
<td>bitand</td>
</tr>

<tr>
<td>|</td>
<td>bitor</td>
</tr>

<tr>
<td>~</td>
<td>compl</td>
</tr>

<tr>
<td>!</td>
<td>not</td>
</tr>

<tr>
<td>!=</td>
<td>not_eq</td>
</tr>

<tr>
<td>||</td>
<td>or</td>
</tr>

<tr>
<td>|=</td>
<td>or_eq</td>
</tr>

<tr>
<td>^</td>
<td>xor</td>
</tr>

<tr>
<td>^=</td>
<td>xor_eq</td>
</tr>

<tr>
<td>{</td>
<td>&lt;%</td>
</tr>

<tr>
<td>}</td>
<td>%&gt;</td>
</tr>

<tr>
<td>[</td>
<td>&lt;:</td>
</tr>

<tr>
<td>]</td>
<td>:&gt;</td>
</tr>

<tr>
<td>#</td>
<td>%:</td>
</tr>

<tr>
<td>##</td>
<td>%:%:</td>
</tr>
</tbody>
</table>

<p>The reason for alternative operators is that the source code maybe not in ASCII set, and don&#39;t have the proper operators.</p>

<p>#cpp <a href="https://rex.writeas.com/tag:programming" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">programming</span></a> <a href="https://rex.writeas.com/tag:operator" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">operator</span></a></p>
]]></content:encoded>
      <guid>https://rex.writeas.com/c-alternative-operators</guid>
      <pubDate>Fri, 10 Jan 2020 02:24:48 +0000</pubDate>
    </item>
  </channel>
</rss>