Code: |
int myitoa(char *s,int n) { return *(short *)(s+(n=(n>9)?myitoa(s,n/10):0))=n%10+'0',n+1; } int main() { char s[10]; myitoa(s,14235); printf("%s\n",s); return 0; } |
( 网页浏览 )
文章来源:http://acm.tongji.edu.cn/people/kaikai/blog/blog.php?job=art&articleid=a_20041119_175739