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.
如果您将输入编码为
std::istream_iterator<std::string> ii(std::cin); std::istream_iterator<std::string> eos; std::for_each(ii,eos,record);
我想知道如果以这种方式编码,您是否可以在控制台中放置一些将终止输入过程的东西。
您可以通过在 Windows 上按 CTRL-Z 或在 Linux 上按 CTRL-D 从终端向标准输入流发送EOF 。