<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>8-bit MicrocontrollersのトピックRe: 908GP32 - Address issue - pointer in C</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/908GP32-Address-issue-pointer-in-C/m-p/136151#M4231</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hello Stefano,&lt;BR /&gt;You'll need to cast the address value to an "int" type to avoid a type mis-match error.&amp;nbsp;&lt;BR /&gt;The following should work:&lt;BR /&gt;&lt;BR /&gt;int myvariable;&lt;BR /&gt;&lt;BR /&gt;int somearray[2];&lt;BR /&gt;&lt;BR /&gt;void main(void) {&lt;BR /&gt;&lt;BR /&gt;myvariable = (int)(&amp;amp;somearray);&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;// now to use "myvariable" as a pointer....&lt;BR /&gt;&lt;BR /&gt;*(&amp;nbsp; (int *)myvariable ) = 20;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // places "20" at somearray[0];&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Note that using pointers that are built by casting can lead to very difficult-to-find bugs.&amp;nbsp; This usually occurs when incrementing or decrementing the pointer.&lt;BR /&gt;&lt;BR /&gt;Frank&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Jun 2007 18:38:58 GMT</pubDate>
    <dc:creator>thisobj</dc:creator>
    <dc:date>2007-06-07T18:38:58Z</dc:date>
    <item>
      <title>908GP32 - Address issue - pointer in C</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/908GP32-Address-issue-pointer-in-C/m-p/136149#M4229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am programmind 908GP32 with codewarrior usign C.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have this question: i have a variable ( int not a pointer) and a data structure (array of int)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I do the following operation?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;myvariable=address data structure&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need this because I am trying to implent a eeprom using flash with the driver descripted in an3040. &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have some suggestion?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tx&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;--&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alban Edit: Changed title: Part number must be shown and clarified subject.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by Alban on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2007-06-07&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;11:36 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jun 2007 17:18:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/908GP32-Address-issue-pointer-in-C/m-p/136149#M4229</guid>
      <dc:creator>Stefano_RadioLa</dc:creator>
      <dc:date>2007-06-07T17:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: 908GP32 - Address issue - pointer in C</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/908GP32-Address-issue-pointer-in-C/m-p/136150#M4230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;&amp;amp;&lt;/B&gt; is the operator for address:&lt;BR /&gt;&lt;BR /&gt;myvariable = &amp;amp;DataStruct;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Alban.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jun 2007 17:39:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/908GP32-Address-issue-pointer-in-C/m-p/136150#M4230</guid>
      <dc:creator>Alban</dc:creator>
      <dc:date>2007-06-07T17:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: 908GP32 - Address issue - pointer in C</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/908GP32-Address-issue-pointer-in-C/m-p/136151#M4231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hello Stefano,&lt;BR /&gt;You'll need to cast the address value to an "int" type to avoid a type mis-match error.&amp;nbsp;&lt;BR /&gt;The following should work:&lt;BR /&gt;&lt;BR /&gt;int myvariable;&lt;BR /&gt;&lt;BR /&gt;int somearray[2];&lt;BR /&gt;&lt;BR /&gt;void main(void) {&lt;BR /&gt;&lt;BR /&gt;myvariable = (int)(&amp;amp;somearray);&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;// now to use "myvariable" as a pointer....&lt;BR /&gt;&lt;BR /&gt;*(&amp;nbsp; (int *)myvariable ) = 20;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // places "20" at somearray[0];&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Note that using pointers that are built by casting can lead to very difficult-to-find bugs.&amp;nbsp; This usually occurs when incrementing or decrementing the pointer.&lt;BR /&gt;&lt;BR /&gt;Frank&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jun 2007 18:38:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/908GP32-Address-issue-pointer-in-C/m-p/136151#M4231</guid>
      <dc:creator>thisobj</dc:creator>
      <dc:date>2007-06-07T18:38:58Z</dc:date>
    </item>
  </channel>
</rss>

