如何在c ++应用程序中将向量元素传递给命令提示符。 [英] How to pass vector elements to command prompt in c++ application.
本文介绍了如何在c ++应用程序中将向量元素传递给命令提示符。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设我在向量中有10个元素我需要通过向元素添加逗号将所有10个元素传递给命令提示符。
向量元素如下所示。
例如:嗨
你好
如何
你
在命令行中必须采用以下格式:你好,怎么样,是你。
有什么解决方案请帮帮我。
提前致谢
解决方案
转到 http://msdn.microsoft.com/en-us/library/cscc687y(v = vs.100).aspx [ ^ ],并采取看看矢量,字符串,字符串流,iostream等。另外 http:// msdn.microsoft.com/en-us/library/277bwbdz(v=vs.100).aspx [ ^ ]。
Suppose i have 10 elements in vector i need to pass all the 10 elements to command prompt by adding comma to the elements.
vector elements are as shown below.
Example:hi
hello
how
are
you
in the command line it has to be in this format:hi,hello,how,are,you.
is there any solution please help me out.
Thanks in advance
解决方案
Go to http://msdn.microsoft.com/en-us/library/cscc687y(v=vs.100).aspx[^], and take a look at vector, string, stringstream, iostream etc. Also http://msdn.microsoft.com/en-us/library/277bwbdz(v=vs.100).aspx[^].
这篇关于如何在c ++应用程序中将向量元素传递给命令提示符。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文