how to in initialize a stringstream
Hi All,
hope someone can tell me how to initialize a stingstream. I have some code I use to send data over the network, this uses stringstream to convert numbers to a stream. It works great. However I've decided to clean my code up with Cppchecker. This is giving me the following error Uninitialized variable: ss my code is Code:
template <class T> std::string to_string(const T& t) Thanks in advance! |
I don't know C++, but I'd try this:
Code:
template <class T> std::string to_string(const T& t) |
Thanks but that just gives a load of errors.
|
Next try:
Code:
#include <string> |
You could try ostringstream to limit it to output-only.
|
I think
Code:
std::stringstream ss(std::ios_base::out); |
Thanks all. I'll give the last one a try why I'm back at my pc, I think that might work. I have noticed that cppchecker which seems very good, seems to give warnings about things that for the life of me I don't think are wrong. But still I feel it would be better if everything has passed
|
All times are GMT -5. The time now is 03:15 AM. |