Answers for "how to get line input c++"

C++
20

get line C++

// extract to string
#include <iostream>
#include <string>

int main ()
{
  std::string name;

  std::cout << "Please, enter your full name: ";
  std::getline (std::cin,name);
  std::cout << "Hello, " << name << "!\n";

  return 0;
}
Posted by: Guest on November-16-2019
0

c++ get full line of input

string s;
getline(cin, s);
Posted by: Guest on February-23-2022

Code answers related to "how to get line input c++"

Browse Popular Code Answers by Language