<?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>topic Simple string assignment problem in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Simple-string-assignment-problem/m-p/171203#M11512</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Banging my head against the wall on the following simple character string assignment problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;char user_text[6];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// somewhere else in code:&lt;/P&gt;&lt;P&gt;user_text[] = {"text"};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Compiler throws up alarm on C1830: Modifiable lvalue expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't want to include string support as I can't support the burden size-wise.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate any help, I'm sure it is something silly and simple.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Dec 2010 06:42:19 GMT</pubDate>
    <dc:creator>protoease</dc:creator>
    <dc:date>2010-12-21T06:42:19Z</dc:date>
    <item>
      <title>Simple string assignment problem</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Simple-string-assignment-problem/m-p/171203#M11512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Banging my head against the wall on the following simple character string assignment problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;char user_text[6];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// somewhere else in code:&lt;/P&gt;&lt;P&gt;user_text[] = {"text"};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Compiler throws up alarm on C1830: Modifiable lvalue expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't want to include string support as I can't support the burden size-wise.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate any help, I'm sure it is something silly and simple.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Dec 2010 06:42:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Simple-string-assignment-problem/m-p/171203#M11512</guid>
      <dc:creator>protoease</dc:creator>
      <dc:date>2010-12-21T06:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Simple string assignment problem</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Simple-string-assignment-problem/m-p/171204#M11513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Aaron,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your string assignment is not allowable in C.&amp;nbsp; With this format, a constant or variable may only be initialised, i.e. at the same&amp;nbsp;time the constant or variable is defined.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To assign data to an array variable within a function, each element of the array woulld need to be individually written.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;user_text[0] = 't';&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;user_text[1] = 'e';&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;user_text[2] = 'x';&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;user_text[3] = 't';&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;user_text[4] = 0;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To copy constant string data into the array variable, you will need to write your own function if you do not wish to include an existing library within your project.&amp;nbsp; Keep in mind that only the code size associated with the particular&amp;nbsp;library&amp;nbsp;functions that you use, will be added to your project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Dec 2010 07:40:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Simple-string-assignment-problem/m-p/171204#M11513</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2010-12-21T07:40:30Z</dc:date>
    </item>
  </channel>
</rss>

