Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:c++中没有itoa这个函数吗?In Reply To:c++中没有itoa这个函数吗? Posted by:gifty_lee at 2008-08-02 13:07:04 itoa 功 能:把一整数转换为字符串 用 法:char *itoa(int value, char *string, int radix); 详细解释:itoa是英文integer to array(将int整型数转化为一个字符串,并将值保存在数组string中)的缩写.其中value为要转化的整数, radix是基数的意思,即先将value转化为radix进制的数,之后在保存在string中. 备注:该函数的头文件是"stdlib.h" 程序例: #include <stdlib.h> #include <stdio.h> int main(){ int number = 123456; char string[25]; itoa(number, string, 10); printf("integer = %d string = %s\n", number, string); return 0; } 注释:编译系统:VC++6.0,TC不支持。 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator