mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-08 15:04:05 +08:00
35 lines
640 B
HTML
35 lines
640 B
HTML
<h1>标准库函数 - itoa</h1>
|
||
|
||
|
||
<p>原型:extern char *itoa(int i);</p>
|
||
|
||
<p>用法:#include <stdlib.h></p>
|
||
|
||
<p>功能:把整数i转换成字符串</p>
|
||
|
||
<p>说明:返回指向转换后的字符串的指针</p>
|
||
|
||
举例:<pre><code class="language-c">
|
||
|
||
// itoa.c
|
||
|
||
#include <syslib.h>
|
||
#include <stdlib.h>
|
||
|
||
main()
|
||
{
|
||
int i=7412;
|
||
|
||
clrscr(); // clear screen
|
||
textmode(0x00);
|
||
|
||
printf("%d",i);
|
||
printf("%s",itoa(i));
|
||
|
||
getchar();
|
||
return 0;
|
||
}
|
||
|
||
</code></pre>相关函数:无
|
||
|