<?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>array to array</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/20113/array-to-array</link><description> 
for example i have got three constant array 

 
code unsigned char a_0[]={0x54,0x25,0x11,0xff,0x21};
code unsigned char a_1[]={0x51,0x45,0x55,0x85};
code unsigned char a_2[]={0x24,0x47};

 

 
in program i want to use this costant similar this; 
send</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: array to array</title><link>https://community.arm.com/thread/47657?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2007 14:54:28 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6e26429d-da33-46cd-8a6c-a74d8de3789f</guid><dc:creator>HansBernhard Broeker</dc:creator><description>&lt;p&gt;&lt;pre&gt;
send(a[i]);
&lt;/pre&gt;

&lt;p&gt;
This can&amp;#39;t work. Something has to tell this function how many
bytes there are in the array you want to send. Objects of different
size can&amp;#39;t be part of the same array without wasting some memory, so
you have to get the size from somewhere else.&lt;/p&gt;

&lt;p&gt;
The closest you can do is&lt;/p&gt;

&lt;pre&gt;
send(a_0, sizeof(a_0))
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
or, slightly more complex:&lt;/p&gt;

&lt;pre&gt;
struct {
  u8 *ptr;
  size_t len;
} a[] = {
   a_0, sizeof(a_0);
   a_1, sizeof(a_1);
   a_2, sizeof(a_2);
};

/*...*/
send(a[i].ptr, a[i].len)
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: array to array</title><link>https://community.arm.com/thread/47656?ContentTypeID=1</link><pubDate>Tue, 23 Jan 2007 06:35:29 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1c4205fb-8e72-48cd-b09e-962b45b3b526</guid><dc:creator>can symon</dc:creator><description>&lt;p&gt;&lt;pre&gt;
code unsigned char a[3][5]={{0x54,0x25,0x11,0xff,0x21},
                         {0x51,0x45,0x55,0x85},
                         {0x24,0x47}};


&lt;/pre&gt;

&lt;p&gt;
for example i can use send(a[2]); but this spend more memory
location then which i need. i try to find a different way.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>