Variable 'Std:ofstream' Has Initializer but Incomplete Type
variable 'std:ofstream’ has initializer but incomplete type
或者是 variable 'std:ifstream’ has initializer but incomplete type
其原因是因为没有包含fstream这个头文件。
#include
main() { fstream f(“filename”); f << 20; f.close(); }
上面这段代码如果没有那个