what is the equivalent of console.readline(); in C++? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

what is the equivalent of console.readline(); in C++?

2nd Oct 2016, 12:39 PM
HACKERMAN
HACKERMAN - avatar
4 Answers
+ 1
string str; getline(cin, str);
2nd Oct 2016, 1:19 PM
kiwiyou
kiwiyou - avatar
+ 1
so #include <iostream> using namespace std; int main() { cout << "Hello World"; return 0; } string str; getline(cin, str);
2nd Oct 2016, 1:24 PM
HACKERMAN
HACKERMAN - avatar
+ 1
ok
2nd Oct 2016, 2:17 PM
Thuc Nguyen
Thuc Nguyen - avatar
+ 1
or even cin.getline(str, size_of_stream) http://www.cplusplus.com/reference/istream/istream/getline/
2nd Oct 2016, 8:30 PM
Artur Dębkowski
Artur Dębkowski - avatar