<?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>Error when using string pointers</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/42992/error-when-using-string-pointers</link><description> 
I have writtena function to display string of characters using
pointer but it shows error. can anybody what is the error in it? 

 
void WriteString(char *Buff)
 {
 int nStringLength;
 int nLoop;

 nStringLength = strlen(Buff);

 for(nLoop=0;nLoop&amp;lt;</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Error when using string pointers</title><link>https://community.arm.com/thread/123800?ContentTypeID=1</link><pubDate>Mon, 30 Apr 2007 08:00:36 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8827b1ce-bf8f-4c65-b61e-31ea6e68d0a3</guid><dc:creator>Suvidh Kankariya</dc:creator><description>&lt;p&gt;&lt;p&gt;
As dan pointed it should be [ ] or alternately use&lt;br /&gt;
SBUF= *Buff and Buff++&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when using string pointers</title><link>https://community.arm.com/thread/112827?ContentTypeID=1</link><pubDate>Mon, 30 Apr 2007 01:46:05 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:592723a0-a60c-4248-bd9f-c0c2702e344c</guid><dc:creator>Gowri Shankar</dc:creator><description>&lt;p&gt;&lt;p&gt;
My main function looks like below,&lt;/p&gt;

&lt;pre&gt;

void main(void)
  {
     InitSerialPort();

     WriteString(&amp;quot;Control Genesis Power Supply&amp;quot;);

     WriteChar(&amp;#39;m&amp;#39;);

     while(1);
   }
&lt;/pre&gt;
&lt;pre&gt;
void InitSerialPort(void)
  {
         TMOD = 0x20;
         TH1  = 0xFD;    // 19200 BAUD RATE
         TL1  = 0x00;
         SCON = 0x50;    // SM0 = 0, SM1 = 1, REN = 1
         TR1  = 0x01;   // RUN CONTROL BIT
  }
&lt;/pre&gt;

&lt;p&gt;
After executing i can see only the character &amp;#39;m&amp;#39; is coming in the
serial port but the string is not coming.&lt;/p&gt;

&lt;p&gt;
I dont know whatis the problem. But this program runs fine with in
the debugger/simulator mode.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when using string pointers</title><link>https://community.arm.com/thread/99163?ContentTypeID=1</link><pubDate>Mon, 30 Apr 2007 01:39:36 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:45143ab5-0cbc-43a3-a245-93b82a602bb9</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;what can be problem?&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Single-step the code in the &lt;b&gt;Simulator&lt;/b&gt; and watch what
happens - That should quickly take you to an answer to your
question...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when using string pointers</title><link>https://community.arm.com/thread/75053?ContentTypeID=1</link><pubDate>Sun, 29 Apr 2007 23:22:17 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3b950d7b-bd1b-447c-a3fa-2c3840f6dfc7</guid><dc:creator>Gowri Shankar</dc:creator><description>&lt;p&gt;&lt;p&gt;
Using that function i couldnt see the characters transmitting in
the serial port.&lt;/p&gt;

&lt;p&gt;
whereas if send a single character it can come to the serial
window.&lt;/p&gt;

&lt;p&gt;
what can be problem?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when using string pointers</title><link>https://community.arm.com/thread/48090?ContentTypeID=1</link><pubDate>Sun, 29 Apr 2007 23:04:03 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3061db4b-f80e-4ddc-a341-a645df0e2002</guid><dc:creator>Dan Henry</dc:creator><description>&lt;p&gt;&lt;p&gt;
Should be:&lt;/p&gt;

&lt;pre&gt;
SBUF = Buff[nLoop];
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>