variable 'std:ofstream’ has initializer but incomplete type
或者是variable 'std:ifstream’ has initializer but incomplete type
其原因是因为没有包含fstream这个头文件。
Cpp代码
#include<fstream>
#include<iostream>
#include<string>
using namespace std;
int main()
{
fstream f("filename");
f << 20;
f.close();
}
上面这段代码如果没有那个就会有标题的错误。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)