I have a char
, a plain old character, that I would like to turn into an std::string
. std::string(char)
doesn't exist of course. I could create a char array and copy it in, I could go through string streams, or many other little roundabout routes. Currently, I prefer boost::lexical_cast
, but even that seems too verbose for this simple task. So what's the preferred way?
Asked
Active
Viewed 3.4k times
53

codeling
- 11,056
- 4
- 42
- 71

pythonic metaphor
- 10,296
- 18
- 68
- 110