从 istream 读取

发布于 2024-09-03 08:15:00 字数 53 浏览 2 评论 0原文

如何在不使用operator>>()的情况下从istream中提取数据(内容)?

How can I extract data (contents) from istream without using operator>>() ?.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

墨落画卷 2024-09-10 08:15:00

如果要从 istream 读取字符,请使用 get 和 getline:

<代码>std::istream::get

< code>std::istream::getline

对于一般阅读,您可能需要使用阅读:

std::istream::read

If you want to read characters from the istream, then by using get and getline:

std::istream::get

std::istream::getline

For general reading you may want to use read:

std::istream::read

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文