Read content of stringstream

Hi,

supposed I just read a string into stringstream. Then I want to check if this string that just being read into is a particular word. for example "dog". how do I check it?

thanks
stringstream stream;

if(!stream.str().compare("dog"))
cout<<"not equal to dog."<<endl;
Topic archived. No new replies allowed.