Hi all,

I´m using a std::stringstream and filling it with several lines. I need to print these lines 2 times and I´m not getting to use it at the second time. I presume that the eofbit is set after the first use so I need to clear it before any other operation. The problem is that even if I clear the bit ( If I´m doing it correctly) the seek(0) dosen´t work, for exemple:
Code:
 std::stringstream strtest;

    strtest << "aaa bbb cccc" << std::endl;
    strtest << "ddd eee ffff" << std::endl;
    strtest << "ggg hhh iiii" << std::endl;

    std::string teste;

   //---- if I comment 2 of these extrations lines the seek(0) works ok
   //---- (Because the EOF is not reached....)
    
    strtest >> teste;
    strtest >> teste;
    strtest >> teste; 
    strtest >> teste;                
    strtest >> teste; 
    strtest >> teste;
    strtest >> teste;
    strtest >> teste;
    strtest >> teste;
    strtest >> teste;

    strtest.unsetf(std::ios::eofbit);
    strtest.unsetf(std::ios::failbit);       //--- for safe
    strtest.unsetf(std::ios::badbit);     //---     " 

    strtest.seekg(0);

    //--- second extration (dosen´t work....)

    strtest >> teste;
    strtest >> teste;
    strtest >> teste; 
    strtest >> teste; 
    strtest >> teste; 
    strtest >> teste;
    strtest >> teste;
    strtest >> teste;
    strtest >> teste;
Can anyone tell me what is wrong???

thank you in advance.