Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:c++中没有itoa这个函数吗?

Posted by Emember at 2008-10-25 21:53:36 on Problem 1002
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator