C語言:將數字轉化爲字符串

#include<stdio.h> #include<assert.h> #include<string.h> //123====>「1 2 3」 將數字轉化爲字符串 char *my_itoa(char *str,int num)//局部變量,出了做用域釋放 { int i=0; while(num!=0) { str[i]=num%10+'0';//獲得字符串「3 2 1」
相關文章
相關標籤/搜索