<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/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>Variables On Multiple Files</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/19763/variables-on-multiple-files</link><description> 
C51: My Program code is distributed over multiple files, I want to
access a variable declared in another file. 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Variables On Multiple Files</title><link>https://community.arm.com/thread/88029?ContentTypeID=1</link><pubDate>Wed, 15 Nov 2006 11:06:32 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7adc1142-4dfb-40de-b4f8-da82226548f1</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;a href="http://c-faq.com/decl/decldef.html"&gt;c-faq.com/.../decldef.html&lt;/a&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Variables On Multiple Files</title><link>https://community.arm.com/thread/47225?ContentTypeID=1</link><pubDate>Wed, 15 Nov 2006 07:11:44 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:67130450-9d83-4bf8-8547-ff675e58333b</guid><dc:creator>Dan Henry</dc:creator><description>&lt;p&gt;&lt;p&gt;
You probably mean &lt;i&gt;defined&lt;/i&gt; in another file where storage is
allocated for it.&lt;/p&gt;

&lt;p&gt;
Create an extern declaration for the variable.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Variables On Multiple Files</title><link>https://community.arm.com/thread/47228?ContentTypeID=1</link><pubDate>Wed, 15 Nov 2006 07:09:59 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4bab11ef-befb-4407-a2aa-500ce2f14ecc</guid><dc:creator>Christoph Franck</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;My Program code is distributed over multiple files,&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
In that case, you are probably already using the &lt;b&gt;extern&lt;/b&gt;
specifier for some of your functions, I guess ?&lt;/p&gt;

&lt;p&gt;
You can use the &lt;b&gt;extern&lt;/b&gt; specifier to access global variables
defined in other files, too.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>