Click here to Skip to main content
15,887,836 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have a problem in
#include <sstream>

What I have tried:

I look where to download the ostringstream but i cant find
Posted
Updated 1-Dec-19 18:30pm
Comments
Mohibur Rashid 2-Dec-19 0:16am    
What is your problem? c or c++?

sstream belongs to c++; it is a standard library. you do not need to download.

1 solution

If you are using C++, then the following code
C++
#include <iostream>
#include <sstream>
using namespace std;

int main()
{
  ostringstream oss;
  oss << "hello " << 12.5;
  cout << oss.str() << endl;
}

should work out of the box, since stringstream - C++ Reference[^] is part of the C++ standard library.
On the other hand, if you are using C (as the question is tagged) then you are out of luck.
 
Share this answer
 
v2
Comments
Maciej Los 3-Dec-19 2:24am    
5ed!
CPallini 3-Dec-19 3:06am    
Thank you!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900