Input Multiple strings at once?

Is there a way to have a user input a line of text (with spaces) and have after each space represent a new string? I know that between each space there will always be 3 characters.
Ideally, I will be placing each string into a vector, with push_back.
It seemed that strings were better than a char array because I don't know how long the entire string will be.

Another idea I had was just looping over my string in pieces of 3 and sending that information to my function, but I'm not sure if that's allowed in c++.
closed account (Dy7SLyTq)

#include <iostream>
#include <stringstream>
#include <vector>
#include <string>

using namespace std;

int main()
vector<string> words;
string line, currentword;

while(getline(cin, line))
if(line == "exit")

istringstream stream(line)

while(stream >> currentword)
Topic archived. No new replies allowed.