<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="Struct (C programming language) - Page 4 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=struct_(C_programming_language)&amp;p=3">1.Previous</a><br />
<a accesskey="3" href="page.php?w=struct_%28C_programming_language%29&amp;p=5">3.Next</a>
</p>
<p>which sets the size in bytes for alignment.</p>

<p>The C struct feature was derived from the same-named concept in <a href="page.php?w=ALGOL_68">ALGOL 68</a>.</p>

<p><big> Declaration </big></p>
<p>The following simple example depicts declaring a struct named <code>MyStruct</code>, with two fields of types <code>Type1</code> and <code>Type2</code> respectively.</p>

<p><syntaxhighlight lang="C">struct MyStruct {    Type1 member1;    Type2 member2;};</syntaxhighlight></p>

<p>The added name <code>MyStruct</code> is optional in some contexts.</p>

<p>Members</p><p>
<a accesskey="1" href="page.php?w=struct_(C_programming_language)&amp;p=3">1.Previous</a><br />
<a accesskey="3" href="page.php?w=struct_%28C_programming_language%29&amp;p=5">3.Next</a>
</p>

<do type="prev" label="Search">
        <go href="search.wml"/>
</do>

</card>
</wml>
