且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将整数转换为字符串可移植?

更新时间:2023-01-16 17:41:10

大多数情况下你只用printf(%D);

Most often you just use printf("%d");

http://en.wikipedia.org/wiki/Printf

如果您需要在缓冲区中,您可以用sprintf,但你经常转换为字符串,而不是将其写入到文件或输出设备?

You can use sprintf if you need it in a buffer, but how often do you convert to a string and not write it to a file or output device?