C语言中如何将数字变成字符串啊?

日期:2019-11-05 14:02:48 人气:1

C语言中如何将数字变成字符串啊?

C语言提供了几个标准库函数,可以将任意类型(整型、长整型、浮点型等)的数字转换为字符串。用itoa()函数将整数转换为字符串,编码如下: # include # include void main (void);void main (void){int num = 100;char str[25];itoa(num, str, 10);printf("The number 'num' is %d and the string 'str' is %s. \n
    A+
热门评论