0

im trying to clear std::strstream using stream.str("") ( How do you clear a stringstream variable? ) but im getting :

error: no matching function for call to 'std::strstream::str(std::string)'
note: candidate is:
note: char* std::strstream::str()

im includeing : #include <strstream>

Community
  • 1
  • 1
Dhia Hassen
  • 508
  • 4
  • 20
  • It's `stringstream`. You're missing letters. – Carcigenicate Oct 18 '16 at 21:58
  • right , write it as answer to be more helpful & ill accept it , but why it is compiling fine when i romove that function call , and i can you strstream class to serve all other purposes – Dhia Hassen Oct 18 '16 at 22:02
  • I can't really write a meaningful answer since I haven't written C++ in like 2 years. This just stood out while I was scrolling. – Carcigenicate Oct 18 '16 at 22:17
  • i don't know how did i wrote that meaningless comment full of mistakes , this is the correct version : ".. but why it is compiling fine when i remove that function call , and i can still use strstream class to serve all other purposes ?" – Dhia Hassen Oct 18 '16 at 22:57
  • There exists [`std::strstream`](http://en.cppreference.com/w/cpp/io/strstream) class. But it doesn't have a method named `str` taking `std::string`. – Igor Tandetnik Oct 19 '16 at 04:12
  • yes i know but why there is two versions with one missing that exact function , there must be some other details – Dhia Hassen Oct 20 '16 at 21:41

0 Answers0