我尝试使用ofstream
将数据写入 OMNET++ 中的 .txt 文件,如下iostream
所示fstream
:
ofstream myfile;
myfile.open ("example.txt");
myfile << "Writing this to a file.\n";
myfile.close();
但是 OMNET++ 没有解析open
和close
功能。
ofstream
除了在 C++ 中实现在 .txt 文件中读取和写入数据的相同任务之外,有人可以提出任何建议吗?