Answers for "Get input for array of unknown length/size in c++"

C++
0

Get input for array of unknown length/size in c++

#include<iostream>
#include<sstream>

using namespace std;

int main()
{
	string s;
    getline(cin, s);
    
    int data
    istringstream iss(s);
    while(iss>>data)
    	cout<<data<<" ";
	return 0;
}
Posted by: Guest on June-26-2021

Browse Popular Code Answers by Language