【发布时间】:2018-12-24 19:30:00
【问题描述】:
大家我是学习计算机科学的初学者,现在我已经学习了 C 语言的一些基础知识。
在 C 语言中,我们可以使用fgets 将多个单词作为输入。接受这种类型的输入的 C++ 等效函数是什么?
【问题讨论】:
-
欢迎来到 stackoverflow.com。请花点时间阅读the help pages,尤其是名为"What topics can I ask about here?" 和"What types of questions should I avoid asking?" 的部分。也请take the tour 和read about how to ask good questions。最后请学习如何创建Minimal, Complete, and Verifiable Example。
-
另外,请阅读this question checklist 和所有idownvotedbecau.se,了解您的问题可能被否决的一些原因。最后请learn how to debug your programs.
-
?我一直认为每个 C 命令也可以在 C++ 中使用。不是吗?
-
您也不应该在 C 中使用
gets,请参阅:Why is the gets function so dangerous that it should not be used?(实际上 C11 标准删除了gets函数) -
C++ 没有“命令”。请从list 获得一本 C++ 书籍。哦,你不能使用gets,C语言中没有这样的功能。