vc6的ofstream中没有attach()?

解决方案 »

  1.   

    #include <iostream>
    using namespace std ;..,...attach() ;
      

  2.   

    代码如下:
             ofstream os;
    int fd = open( szFileName, _O_APPEND, _S_IREAD);
    if ( 0 == fd )
    return ; os.attach( fd );
    编译结果:
      error C2039: 'attach' : is not a member of 'basic_ofstream<char,struct std::char_traits<char> >'
      

  3.   

    stl 的 iostream 好像没有 attach ,改为 #include <fstream.h> 试试
      

  4.   

    thanks  In355Hz(好象一条狗)