﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-redbox</title><link>http://www.cppblog.com/redbox/</link><description /><language>zh-cn</language><lastBuildDate>Fri, 17 Apr 2026 13:27:46 GMT</lastBuildDate><pubDate>Fri, 17 Apr 2026 13:27:46 GMT</pubDate><ttl>60</ttl><item><title>itoa函数 solaris源码</title><link>http://www.cppblog.com/redbox/archive/2006/01/05/2455.html</link><dc:creator>redbox</dc:creator><author>redbox</author><pubDate>Thu, 05 Jan 2006 13:58:00 GMT</pubDate><guid>http://www.cppblog.com/redbox/archive/2006/01/05/2455.html</guid><wfw:comment>http://www.cppblog.com/redbox/comments/2455.html</wfw:comment><comments>http://www.cppblog.com/redbox/archive/2006/01/05/2455.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/redbox/comments/commentRss/2455.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/redbox/services/trackbacks/2455.html</trackback:ping><description><![CDATA[<TABLE cellSpacing=0 cellPadding=0 width="95%" border=0>
<TBODY>
<TR>
<TD align=middle width="100%">
<H2>&nbsp;</H2></TD></TR>
<TR>
<TD width="100%">
<P>char *<BR>itoa(n, base)<BR>long&nbsp;n;&nbsp;&nbsp;&nbsp;/* abs k16 */<BR>int&nbsp;base;<BR>{<BR>&nbsp;register char&nbsp;*p;<BR>&nbsp;register int&nbsp;minus;<BR>&nbsp;static char&nbsp;buf[36];</P>
<P>&nbsp;p = &amp;buf[36];<BR>&nbsp;*--p = '';<BR>&nbsp;if (n &lt; 0) {<BR>&nbsp;&nbsp;minus = 1;<BR>&nbsp;&nbsp;n = -n;<BR>&nbsp;}<BR>&nbsp;else<BR>&nbsp;&nbsp;minus = 0;<BR>&nbsp;if (n == 0)<BR>&nbsp;&nbsp;*--p = '0';<BR>&nbsp;else<BR>&nbsp;&nbsp;while (n &gt; 0) {<BR>&nbsp;&nbsp;&nbsp;*--p = "0123456789abcdef"[n % base];<BR>&nbsp;&nbsp;&nbsp;n /= base;<BR>&nbsp;&nbsp;}<BR>&nbsp;if (minus)<BR>&nbsp;&nbsp;*--p = '-';<BR>&nbsp;return p;<BR>}</P></TD></TR></TBODY></TABLE><img src ="http://www.cppblog.com/redbox/aggbug/2455.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/redbox/" target="_blank">redbox</a> 2006-01-05 21:58 <a href="http://www.cppblog.com/redbox/archive/2006/01/05/2455.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>