0

I'm trying to consume the rest of an input on cin. Currently my function does this ...

void foo() {
    // Input "514 G Alex Thornton
    std::cin >> INT >> STD::STRING >> STD::STRING
}

So far the int variable consumes 514, and the first string variable consumes G; however, that leaves the name remaining, which can be an infinite amount of words. Is there a way to consume the rest of the line?

Jacob Macallan
  • 959
  • 2
  • 8
  • 29

0 Answers0