I did, it (echo in command line) works well with much longer 1024 characters.
I have created a simple program, compile with MS Visual studio and run with Win 10. The limit is much longer (4096) but still reachable.
Can someone help to test it? Just run below code, copy and paste any string, repeat until the program refuses to show more and then press enter, you will see the length of the string the getline function accepted:
Code: Select all
#include <iostream>
#include <sstream>
void main() {
std::string str;
while (true) {
if (!getline(std::cin, str))
break;
std::cout << "str length: " << str.length() << std::endl;
}
}