C Getline String Code Example


Example: 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 }

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable