由vks_vinay进行c编程 [英] c-programming by vks_vinay

查看:71
本文介绍了由vks_vinay进行c编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将存储在变量中的整数转换为字符串(仅对变量应用操作)

how to convert an integer stored in a variable into string(applying operation only on variable)

推荐答案

使用itoa作为他评论中已提及的ThePhantomUpvoter或者如果你想要能够做一些更精美的格式化使用sprintf,这使你能够打印到一个字符串,其中包含printf所具有的所有格式化选项。



干杯!
Use itoa as ThePhantomUpvoter already mentioned in his comment or if you want the ability to do some more fancy formatting use sprintf which gives you the ability to "print" to a string with all the formatting options you'd also have with printf.

Cheers!


这篇关于由vks_vinay进行c编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆