+ 1
what is the equivalent of console.readline(); in C++?
4 Antworten
+ 1
string str;
getline(cin, str);
+ 1
so
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World";
return 0;
}
string str;
getline(cin, str);
+ 1
ok
+ 1
or even cin.getline(str, size_of_stream)
http://www.cplusplus.com/reference/istream/istream/getline/