D:\VC6.0\Project\EXE\OpenFile.cpp(54) : error C2228: left of '.open' must have class/struct/union type
D:\VC6.0\Project\EXE\OpenFile.cpp(55) : error C2228: left of '.read' must have class/struct/union type fstream file();
file.open("c.las",ios::in|ios::out|ios::binary|ios::nocreate);
file.read(list,9);这是出错的地方,头文件包括了#include"fstream.h"
谁能指导下是怎么回事?

解决方案 »

  1.   

    //fstream file() 出错了; 
    fstream file; 
    file.open("c.las",ios::in ¦ios::out ¦ios::binary ¦ios::nocreate); 
    file.read(list,9);
     
      

  2.   

    //fstream file() 出错了; 
    fstream file; 
    file.open("c.las",ios::in ¦ios::out ¦ios::binary ¦ios::nocreate); 
    file.read(list,9);
     
      

  3.   

    fstream file(); 
    把file后面的括号去掉就可以了!
    你试试!
      

  4.   

    //fstream file();有你这麽生成对象的嘛? 
    fstream file;
    file.open("c.las",ios::in ¦ios::out ¦ios::binary ¦ios::nocreate); 
    file.read(list,9); 
      

  5.   

    本来是定义和打开操作一起的,
    fstream file("c.las",ios::in ¦ios::out ¦ios::binary ¦ios::nocreate)的,改用open函数后忘记括号了