Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <218F3B0E5BBBD511899300B0D0F90F30013469A1@mail.ansoft.com> From: Silqun Leung To: "'cygwin AT cygwin DOT com'" Subject: Issue with stringstream class Date: Thu, 2 Jan 2003 13:29:22 -0500 MIME-Version: 1.0 Content-Type: text/plain Hello, I am having some difficulty with the stringstream class. Here is a simple program I run: #include #include #include int main(int argc, char* argv[]) { std::string temp; std::string stuff = "asdf asdf asdf asdf asdf"; std::stringstream a; a << stuff.c_str(); std::cout << a.str() << std::endl; a >> temp; std::cout << a.str(); return 0; } The output when built with g++ is: asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf This is not what I expect when using the >> operator. I looked at the stringstream class and do not see it overloading the >> operator and believe that it should be inheriting from the same place as the ifstream class. When I use the >> operator on a std::ifstream object, it is destructive, however this does not appear to be the case for the stringstream object (which I believe it should be). Using the same program with Visual C++ will yield correct results (ie. an output of asdf asdf asdf asdf asdf asdf asdf asdf asdf Is this a bug in the implementation of the stringstream class? Thanks, Silqun -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/