How to convert stringstream to string in C++

1 Answer

0 votes
#include <iostream>  
#include <sstream>  

int main() {  
    std::stringstream ss("c++");  

    std::string s = ss.str();

    std::cout << s;
    
    return 0;
}  




/*
run:

c++

*/

 



answered Jan 14, 2021 by avibootz

Related questions

1 answer 96 views
3 answers 653 views
1 answer 336 views
1 answer 261 views
2 answers 342 views
2 answers 97 views
...