方法一:

#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
    int a = 2;
    string b = "abc";
    stringstream ss;
    ss << a << b;
    cout << ss.str() << endl;
    return 0;
}
 
方法二:

#include <iostream>
using namespace std;
int main()
{
  int a = 6;
  char b[10];
  sprintf_s(b, "abc%d", a);
  cout << b << endl;
  system("pause");
  return 0;
}

最新文章

  1. HTML5- Canvas入门(五)
  2. Apache的详细安装教程和遇到的问题解决方案
  3. 线程的Alertable与User APC
  4. Qt for Mac 安装(包括PyQt)
  5. 使用Monkey进行压力测试
  6. Strange Problem O(∩_∩)O~
  7. figure元素
  8. 使用hue+oozi构建任务调度系统
  9. yarn的调度策略
  10. 如何在Azure Websites中配置PHP从而改变系统默认时区
  11. Cisco CatOS系统交换机的SPAN配置
  12. 如何安装(装载)axure组件(部件)
  13. LeetCode &amp; Q189-Rotate Array-Easy
  14. ASP.NET MVC上传文件
  15. (转)SQLServer_十步优化SQL Server中的数据访问五
  16. idea连接mysql
  17. Springboot &amp; Mybatis 构建restful 服务三
  18. glassfish SEC5054: Certificate has expired
  19. Nginx – rewrite 配置 URL重写及301跳转原理图
  20. JavaScript 记录页面停留时间-通过测试

热门文章

  1. 生成PW配置和BFD配置
  2. (21)Spring Boot过滤器、监听器【从零开始学Spring Boot】
  3. LightOJ - 1232 - Coin Change (II)
  4. asp.net--WebService知识点
  5. 关于Bubblesort算法
  6. P2310 loidc,看看海
  7. Python 远程调用MetaSploit
  8. strcpy函数使用方法以及底层实现
  9. 状态压缩dp poj 3254 hdu5045
  10. 【POJ 2044】 Weather Forecast