1、轉換成字符串。
比較好用:sprintf(s, "%-8d%8d", 123, 4567);
注意:
double aaa =1.0000;
sprintf(s, "ld", aaa);
結果:s = 0000000;//錯誤
所以要保證aaa的類型與第二參數 ("ld")一致,否則可能出錯。
2、
字符串轉。。。
strtol(long)/strtoul(unsigned long),strtod(double)
atoi 、gcvt、itoa、。。。
然後強轉,勉強夠用了。