I think we are here: [https://stackoverflow.com/a/5558123](https://stackoverflow.com/a/5558123)
> Depending on your OS, the command line input will only accept 8191 characters > for XP and 2047 characters for NT and Windows 2000. Under **Windows 10** , console input using **fgets /fgetws** is still restricted to **2046** characters + '\r' \+ '\0', amounting to **2048** characters in total. On the other hand we cannot set **2048** as a hard limit in **fgets /fgetws** because we do not know what the future will bring. And perhaps there is still a possibility for an executable to be run under a quite outdated **Windows XP** installation? As for **readConsoleW** its hard limit is set by us to whatever value we put in **numberOfCharsToRead**. And the read operation is completed at once; no extra calls to **readConsoleW** are useful. Should we set **numberOfCharsToRead = 2048** to be in unison with **fgets /fgetws**? Most probably yes...