get rest of a stringstream c++

#include <iostream>
#include <sstream>

int main() {
    std::stringstream ss("This is a sample sentence.");

    std::string word;
    while (ss >> word) {
        // Process each word here
        std::cout << "Word: " << word << std::endl;
    }

    return 0;
}