gpt4 book ai didi

c++ - 打开文件的字符串变量

转载 作者:行者123 更新时间:2023-11-28 03:23:43 25 4
gpt4 key购买 nike

<分区>

我的代码应该打开 100 个文件(并用它们做一些事情),路径中的下一个索引如下:"c:\Naprzeme\NAPRZ100.IN"下一个是 "c:\Naprzeme\NAPRZ101.IN"等等:

for (int as=100;as<159;as++){
ostringstream ss;
ss << as;
string cherk = ss.str();
string supremeCounter = "c:\\Naprzeme\\NAPRZ"+cherk+".IN";
fstream infile(supremeCounter);
//....other code here
}

fstream infile(supremeCounter)返回错误

28 31 C:\Users\talent\Documents\File.cpp [Error] no matching
function for call to 'std::basic_fstream<char>::basic_fstream(std::string&)'
candidates are: //(here some libs)...

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