read a whole line from the input

#include <iostream>
#include <string>

int main() {
    std::string inputLine;

    std::cout << "Enter a line of text: ";
    std::getline(std::cin, inputLine);

    std::cout << "You entered: " << inputLine << std::endl;

    return 0;
}