Loading... <div class="tip inlineBlock success"> sprintf函数的作用是:数据输出到字符串 </div> ### 须包含头文件: #include<stdio.h> ### 用法: sprintf(字符串,变量数据类型,变量); ### 代码实例: ```cpp #include<stdio.h> int main(void) { char c[10]; int a, b; a = 123; b = 456; sprintf(c,"%d%d", a, b); printf("%s", c); return 0; } ``` 最后修改:2021 年 08 月 28 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 0 如果文章有用,请随意打赏。