Define "output". You never print any numbers. The only numbers that will be visible are the ones from standard input.
The code within the while loop will always be executed at least once because input is initially 0 on line 3.
Last edited on
Following Enoizats example
1 2 3 4 5 6 7 8 9 10 11
|
#include <iostream>
#include <sstream>
int main()
{
int input {};
std::istringstream iss { "1 2 88 42 99" };
while (iss >> input && input != 42)
std::cout << input << '\n';
}
|
Output:
Last edited on