Answers for "getline funtion in c++"

C++
5

getline cpp

//getline allows for multi word input including spaces ex. "Jim Barens"
#include <iostream>
#include <string>

int main() 
{
  string namePerson{};     // creating string
  getline(cin, namePerson);// using getline for user input
  std::cout << namePerson; // output string namePerson
}
Posted by: Guest on October-20-2020
0

c++ getline

getline
Posted by: Guest on January-17-2022

Browse Popular Code Answers by Language