<?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>CX51 strtoul library routine</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/16545/cx51-strtoul-library-routine</link><description> CX51 not support strtoul library routine ! 
 
unsigned long x; 
unsigned char c[]=&amp;quot;12345678&amp;quot; 
 
x = strtoul (c,NULL,10); 
 
returned zero ? </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: CX51 strtoul library routine</title><link>https://community.arm.com/thread/95742?ContentTypeID=1</link><pubDate>Fri, 29 Aug 2003 13:28:34 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a65f9feb-742d-4334-b91c-29da25bec79c</guid><dc:creator>M.Yasar  ORHON</dc:creator><description>&lt;p&gt;If you select device P89C669 or other&lt;br /&gt;
MX , this code not working (return FF..),&lt;br /&gt;
If select no MX device working correctly !!&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;REG51M.H&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void main (void)&lt;br /&gt;
{&lt;br /&gt;
unsigned long v;&lt;br /&gt;
&lt;br /&gt;
unsigned char x[]=&amp;quot;12345678&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
	while (1)&lt;br /&gt;
	{&lt;br /&gt;
		v=strtoul(&amp;quot;1234&amp;quot;,NULL,10);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CX51 strtoul library routine</title><link>https://community.arm.com/thread/71792?ContentTypeID=1</link><pubDate>Fri, 29 Aug 2003 12:21:36 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b24dacb8-c63d-401e-80ed-27329a45d9fc</guid><dc:creator>Drew Davis</dc:creator><description>&lt;p&gt;I use strtoul() extensively in a command-line interface.  Seems to work fine, though I usually use 0 as the third argument to allow for any base to be input.&lt;br /&gt;
&lt;br /&gt;
strtoul() will return zero if it doesn&amp;#39;t like its input, say if the first character isn&amp;#39;t a decimal digit.  What is the value in the array c when the call occurs?  The array is initialized data; did you include the code to copy initialized data from ROM to RAM in your project?  What happens if you make a literal call (strtoul (&amp;quot;1234&amp;quot;, NULL, 10))?&lt;br /&gt;
&lt;br /&gt;
You might consider declaring string constants as &lt;b&gt;code&lt;/b&gt;.  They can remain in your ROM that way and save some space.  Your memory implementation may favor one location over the other.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CX51 strtoul library routine</title><link>https://community.arm.com/thread/40817?ContentTypeID=1</link><pubDate>Fri, 29 Aug 2003 10:20:03 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b43c032d-82d8-44c8-b1e7-5536b2750f0c</guid><dc:creator>John Donaldson</dc:creator><description>&lt;p&gt;unsigned char c[]=&amp;quot;12345678&amp;quot;&lt;br /&gt;
&lt;br /&gt;
I assume you do really have a semicolon at the end of the above line?&lt;br /&gt;
&lt;br /&gt;
Did you include stdlib.h?&lt;br /&gt;
&lt;br /&gt;
Stefan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>