core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_char_const_as_int.htm
author timkelly
Thu, 10 Dec 2009 13:45:47 -0600
branchRCL_2_4
changeset 671 80524b72f957
parent 0 fb279309251b
child 1641 2b3996fc09a1
permissions -rw-r--r--
Add S60 5.2 support.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="LASTUPDATED" content="06/17/05 11:09:43" />
<title>Character Constants as Integer Values</title>
<link rel="StyleSheet" href="../../book.css" type="text/css"/>
</head>
<body bgcolor="#FFFFFF">
<h3>Character Constants as Integer Values</h3>
<p>(ISO C, &sect;6.4.4.4) The C compiler lets you use string literals containing 2 to 8 characters to denote 32-bit or 64-bit integer values. Table 2.2 shows examples.</p>
<p>Table 2.2 Integer Values as Character String Constants</p>
<table width="73%"  border="0" cellpadding="2" cellspacing="0">
  <tr>
    <th width="33%" scope="col">Character constant</th>
    <th width="67%" scope="col">Equivalent hexadecimal integer value</th>
  </tr>
  <tr>
    <td class="code">'ABCDEFGH'</td>
    <td><span class="code">0x4142434445464748</span> (64-bit value)</td>
  </tr>
  <tr>
    <td class="code">'ABCDE'</td>
    <td><span class="code">0x0000000041424344</span> (64-bit value)</td>
  </tr>
  <tr>
    <td class="code">'ABCD'</td>
    <td><span class="code">0x41424344</span> (32-bit value)</td>
  </tr>
  <tr>
    <td class="code">'ABC'</td>
    <td><span class="code">0x00414243</span> (32-bit value)</td>
  </tr>
  <tr>
    <td class="code">'AB'</td>
    <td><span class="code">0x00004142</span> (32-bit value)</td>
  </tr>
</table>
<p>You cannot disable this extension, and it has no corresponding pragma or setting in any panel.</p>
<p class="note"><strong>NOTE</strong> This feature differs from using multibyte character sets, where a single character requires a data type larger than 1 byte. See <a href="c_multibyte_support.htm">Multibyte and Unicode Support</a> for information on using character sets with more than 256 characters (such as Kanji).<br />
</p>
<div id="footer">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>


</body>
</html>