core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_sizeof_type.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>Sizeof() Operator Data Type</title>
<link rel="StyleSheet" href="../../book.css" type="text/css"/>
</head>
<body bgcolor="#FFFFFF">
<h3>Sizeof() Operator Data Type</h3>
<p>The <span class="code">sizeof()</span> operator returns the size of a variable or type in bytes. The data type of this size is <span class="code">size_t</span>, which the compiler declares in the file <span class="code">stddef.h</span>. If your source code assumes that <span class="code">sizeof()</span> returns a number of type <span class="code">int</span>, it might not work correctly.</p>
<p class="note"><strong>NOTE</strong> The compiler evaluates the value returned by <span class="code">sizeof()</span> only at compile time, not runtime.</p>
<p class="note"><strong>NOTE</strong> The <span class="code">sizeof()</span> operator is not intended to work in preprocessor <span class="code">#if/#elif</span> directives.<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>