fstream 和 ostrstream 未定义

Arv*_*ind 3 visual-c++

你好,

我正在使用 vs 2010 将我的项目从 vc6 转换为最新版本。我在编译代码时遇到问题

错误 931 错误 C2065:'ostrstream':未声明的标识符 1100 IntelliSense:标识符“fstream”未定义

我已经按照 Google 的说明包含了所需的文件

#if ! defined(_FSTREAM_)
    #include <fstream> 
#endif 

#if ! defined(_STRSTREAM_)      
   #include <strstream>      
#endif 
Run Code Online (Sandbox Code Playgroud)

当我在 fstream 或 ostrstream 上按 F12 时,它会转到定义这些类的相应文件。还有其他我必须做的吗,我已经搜索了很长时间但没有运气:(

谢谢

阿尔文德

小智 6

将这些添加到您的库列表中:

#include <stdio.h>

using namespace std;
Run Code Online (Sandbox Code Playgroud)