<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Flight Simulator 101 or back to college - part 16: C Structures with in Structures</title><link>/members-area/personalblogs/b/nexgen-flight-simuator/posts/flight-simulator-101-or-back-to-college---part-15-c-structures-with-in-structures</link><description>Now, Somewhere on the Stack Exchange, I heard some crud about you just can&amp;#39;t have a struct as a member of a struct. Well, you sure can and now for all the curious minds out there I will show you how to do it. Remember I work with flight simulation, s</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Flight Simulator 101 or back to college - part 16: C Structures with in Structures</title><link>https://community.element14.com/members-area/personalblogs/b/nexgen-flight-simuator/posts/flight-simulator-101-or-back-to-college---part-15-c-structures-with-in-structures</link><pubDate>Fri, 05 May 2023 21:43:54 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:5548b828-800c-49b4-b4d4-dfae99ca5afa</guid><dc:creator>jc2048</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;K&amp;amp;R edition 2 [the 'ANSI C' one] says: &amp;quot;Structures can be nested.&amp;quot;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t understand why you need to create instances of the first structure before incorporating it within the second.&lt;/p&gt;
&lt;p&gt;What are you using for a compiler? I&amp;#39;ve just tried the following simple program with VC++ 2010 and it compiled and ran fine.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-5548b828-800c-49b4-b4d4-dfae99ca5afa/structures.png" /&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25865&amp;AppID=300&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Flight Simulator 101 or back to college - part 16: C Structures with in Structures</title><link>https://community.element14.com/members-area/personalblogs/b/nexgen-flight-simuator/posts/flight-simulator-101-or-back-to-college---part-15-c-structures-with-in-structures</link><pubDate>Fri, 05 May 2023 01:58:34 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:5548b828-800c-49b4-b4d4-dfae99ca5afa</guid><dc:creator>phoenixcomm</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;in stead of this:&lt;/p&gt;
&lt;p&gt;struct DM {&lt;br /&gt; int degrees;&lt;br /&gt; float minutes;&lt;br /&gt; char hemi; &lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;struct DM Lat;&lt;br /&gt;struct DM Lon;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I most likely could have done this:&lt;/p&gt;
&lt;p&gt;struct DM {&lt;br /&gt; int degrees;&lt;br /&gt; float minutes;&lt;br /&gt; char hemi; &lt;br /&gt; } &amp;nbsp;Lat,&amp;nbsp;Lon;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25865&amp;AppID=300&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Flight Simulator 101 or back to college - part 16: C Structures with in Structures</title><link>https://community.element14.com/members-area/personalblogs/b/nexgen-flight-simuator/posts/flight-simulator-101-or-back-to-college---part-15-c-structures-with-in-structures</link><pubDate>Thu, 04 May 2023 19:36:47 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:5548b828-800c-49b4-b4d4-dfae99ca5afa</guid><dc:creator>DAB</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;An elegant solution.&lt;/p&gt;
&lt;p&gt;I am not surprised that you can reference a structure within a structure.&lt;/p&gt;
&lt;p&gt;The C language was always about building large data structures from smaller data structures.&lt;/p&gt;
&lt;p&gt;As long as all of the elements are correctly defined, the compiler just does not care.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25865&amp;AppID=300&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Flight Simulator 101 or back to college - part 16: C Structures with in Structures</title><link>https://community.element14.com/members-area/personalblogs/b/nexgen-flight-simuator/posts/flight-simulator-101-or-back-to-college---part-15-c-structures-with-in-structures</link><pubDate>Thu, 04 May 2023 08:08:49 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:5548b828-800c-49b4-b4d4-dfae99ca5afa</guid><dc:creator>Andrew J</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I&amp;rsquo;m not an experienced C or C++ programmer so please bear with a probably simple question: why do you have to declare Lat and Lon as DM types on the first code block lines 7 and 8, and then again within Struct Position on lines 2 and 3 of the second code block?&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25865&amp;AppID=300&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Flight Simulator 101 or back to college - part 16: C Structures with in Structures</title><link>https://community.element14.com/members-area/personalblogs/b/nexgen-flight-simuator/posts/flight-simulator-101-or-back-to-college---part-15-c-structures-with-in-structures</link><pubDate>Wed, 03 May 2023 23:36:08 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:5548b828-800c-49b4-b4d4-dfae99ca5afa</guid><dc:creator>colporteur</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;You make it looks so easy:)&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25865&amp;AppID=300&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Flight Simulator 101 or back to college - part 16: C Structures with in Structures</title><link>https://community.element14.com/members-area/personalblogs/b/nexgen-flight-simuator/posts/flight-simulator-101-or-back-to-college---part-15-c-structures-with-in-structures</link><pubDate>Wed, 03 May 2023 21:42:27 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:5548b828-800c-49b4-b4d4-dfae99ca5afa</guid><dc:creator>dang74</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I wasn&amp;#39;t aware of this restriction but when you Google you do indeed see some results indicating that you can&amp;#39;t have a struct as a member of a struct.&amp;nbsp; At any rate, I&amp;#39;m glad you smashed through this &amp;#39;barrier&amp;#39;.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25865&amp;AppID=300&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>