Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how to take space separated input in c++

#include <string>
#include <vector>
...
  string rawInput;
  vector<String> numbers;
  while( getline( cin, rawInput, ' ' ) )
  {
    numbers.push_back(rawInput);
  }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #space #separated #input
ADD COMMENT
Topic
Name
9+3 =