概要
to_string
代码
// ConsoleApplication20.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <iostream>
#include<string>
using namespace std;
int main()
{
string str1 = "";
int a = 5;
string str2 = to_string(5);
cout << "str2:" << str2 << "\n";
std::cout << "Hello World!\n";
getchar();
}
运行