Answers for "start reading next line c++"

C++
1

how to read a line from the console in c++

#include <string>
std::string str;
std::getline(std::cin, str);
// The output of std::getline(std::cin, str) will be stored in str.
Posted by: Guest on November-06-2020
0

read full line in c++

string line;

while (getline(cin, line)) {
    // do something with the line
}
Posted by: Guest on December-29-2021

Browse Popular Code Answers by Language