How can I make my char like this?
const double version_num_ = 1.0;
const char *version_ = "v" + version_num_;
I am getting an error which says "expression must have integral or unscoped enum type"
Thanks :)
Easiest way is with a stringstream.
1 2 3 4 5 6 7
|
#include <sstream>
std::stringstsream ss;
char * version;
ss << "v" << 1.0;
version = ss.str().c_str();
| |
Last edited on
But my const char is a class member. Is there another way? Thanks.
*NEVERMIND I FOUND A WAY.*
I just did this...
const char *version_ = "v1.0";
Last edited on