<?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>unions ?</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/19752/unions</link><description> 
I want to make a function that accepts 3 calling parameters but
one of which is either be a string or an integer. So in an attempt to
realise it I started to play with the following. 

 
But I get a warning on APItest.c(62): error: #137: expression</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: unions ?</title><link>https://community.arm.com/thread/98620?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2006 11:37:11 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d31dd7c7-8a15-489d-b374-8c354cfb165c</guid><dc:creator>Graham Gollings</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks Andy,&lt;/p&gt;

&lt;p&gt;
I was in a bookshop last night and definately saw an example
written in the way I used it. But I purchased another book Sam&amp;#39;s
which doesn&amp;#39;t. I&amp;#39;m not doubting you, because it doesn&amp;#39;t work, but I
will go back and take another look at the book for the heck of
it.&lt;/p&gt;

&lt;p&gt;
Thanks about the local, got it.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: unions ?</title><link>https://community.arm.com/thread/88016?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2006 02:25:12 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:af442978-7519-4eb0-b397-f58f3b3bfaec</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;Note I can only look at the results in the watch window if I
declare the struct in main as static&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
You have defined it as a &lt;b&gt;local&lt;/b&gt; variable - so it doesn&amp;#39;t
actually exist outside the function.&lt;br /&gt;
If you make it static, it continues to &lt;i&gt;exist&lt;/i&gt; but is not
visible outside the function by &amp;#39;C&amp;#39; scoping rules (the debugger has
syntax to get around this).&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: unions ?</title><link>https://community.arm.com/thread/47174?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2006 02:21:33 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a37312b8-a0cf-441a-a160-27e77fa27757</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
You cannot assign a string literal - such as &amp;quot;Hello&amp;quot; - to an
&lt;b&gt;array&lt;/b&gt; at runtime.&lt;br /&gt;
You can only do this as a special case when you initialise an array
in its definition.&lt;/p&gt;

&lt;p&gt;
If you want to assign a string literal - such as &amp;quot;Hello&amp;quot; - at
runtime, you will have to use a &lt;b&gt;pointer&lt;/b&gt;;&lt;br /&gt;
If you want to use an &lt;b&gt;array&lt;/b&gt;, you will have to copy the
characters of the string using strcpy or similar.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>