gpt4 book ai didi

c++ - 使用 std::istream_iterator 从文件中读取行。 WHO?

转载 作者:行者123 更新时间:2023-11-30 04:38:52 24 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
How do I iterate over cin line by line in C++?

我需要从文件中读取所有行:

std::ifstream file("...");
std::vector<std::string> svec(
(std::istream_iterator<std::string>(file)),
(std::istream_iterator<std::string>()),
);

但它被读作单词。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com