cpp iterate words of string
#include <iostream>
#include <string>
#include <sstream>
int main() {
std::string inputString = "Hello World!";
std::istringstream iss(inputString);
do {
std::string word;
iss >> word;
if (word != "")
std::cout << "Word: " << word << std::endl;
} while (iss);
return 0;
}