C++14 introduced std::quoted to add double quotes to strings
/*================================================================
* Copyright (C) 2021 baichao All rights reserved.
*
* 文件名称:quoted.cpp
* 创 建 者:baichao
* 创建日期:2021年01月06日
* 描 述:
*
================================================================*/
#include <iostream>
#include <string>
#include <iomanip>
int main()
{
std::string str = "Hello World";
std::cout<<str<<std::endl;
std::cout<< std::quoted(str)<<std::endl;
}
operation result:
Note that this is a new feature after c++14