#include <iostream>
#include <string>
int main()
{
std::string name;
std::cout << "What is your name? ";
getline (std::cin, name);
std::cout << "Hello, " << name << "!\n";
while (true);
std::cout<<"over";
}
Program outputs “What is your name” and I input my name, say “Dom”, but the program then waits there. Why doesn’t it show “Hello Dom!” before it gets stuck at the while loop?