core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_zero_length_arrays.htm
equal
deleted
inserted
replaced
|
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><html> |
|
2 <head> |
|
3 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> |
|
4 <meta http-equiv="Content-Style-Type" content="text/css" /> |
|
5 <meta name="LASTUPDATED" content="06/17/05 11:09:43" /> |
|
6 <title>Arrays of Zero Length in Structures</title> |
|
7 <link rel="StyleSheet" href="../../book.css" type="text/css"/> |
|
8 </head> |
|
9 <body bgcolor="#FFFFFF"> |
|
10 <h3>Arrays of Zero Length in Structures</h3> |
|
11 <p> If you disable the <a href="../pragmas/p_ANSI_strict.htm">ANSI Strict</a> setting , the compiler lets you specify an array of no length as the last item in a structure. Listing 1 shows an example. You can define arrays with zero as the index value or with no index value.</p> |
|
12 <div class="listing"> |
|
13 <h5>Listing 1. Using Zero-length Arrays</h5> |
|
14 <p>struct listOfLongs {<br /> |
|
15 long listCount;<br /> |
|
16 long list[0]; // OK if ANSI Strict is disabled, [] is OK, too.<br /> |
|
17 }<br /> |
|
18 </p> |
|
19 </div> |
|
20 <div id="footer">Copyright © 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> |
|
21 |
|
22 |
|
23 </body> |
|
24 </html> |