我有一个vector<int>有整数的容器(例如{1,2,3,4}),我想转换为表格的字符串
"1,2,3,4"
Run Code Online (Sandbox Code Playgroud)
在C++中最干净的方法是什么?在Python中,我就是这样做的:
>>> array = [1,2,3,4]
>>> ",".join(map(str,array))
'1,2,3,4'
Run Code Online (Sandbox Code Playgroud) 在C++中,将int(即vector<int>)向量转换为字符串的最简单方法是什么?