我的函数 用到 ifstream  函数,错误提示没有定义,请问下,头文件是什么啊 

解决方案 »

  1.   

    #include <fstream>
    using namespace std;
      

  2.   

      不+ using namespace std;行不行啊。
     我用容器做
         ifstream infile("D:\\1.7.txt");
         if(!infile)
    AfxMessageBox( "Unable to open this file");
         vector<double> files;
        while(infile >> word)
    files.push_back(word);头文件定义是这样的 
    #include "fstream.h"
    #include <vector> 
    #include <algorithm>调试结果错误如下D:\学习专用\数值计算\512\512Dlg.cpp(187) : error C2062: type 'double' unexpected
    D:\学习专用\数值计算\512\512Dlg.cpp(190) : error C2065: 'files' : undeclared identifier
    D:\学习专用\数值计算\512\512Dlg.cpp(190) : error C2228: left of '.push_back' must have class/struct/union type
    问下 错在那里啊 
      

  3.   

    可以不加using namespace std;
    但是要在方法前加std::
     std::ifstream infile("D:\\1.7.txt");