Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 C++ 中输入字符串?
我一般用gets。但不适用于二维数组。另一方面 cin 忽略空白后的文本。我希望输入是确切的未格式化文本。
你可以像这样使用它:-
char input[100]; cin.getline(input,100);
查看cin.getline()