
30 Jan
2012
30 Jan
'12
1:40 p.m.
On Mon, Jan 30, 2012 at 8:17 AM, Claude
What is the better way for convert a numeric type into a const char *? I use:
(boost::lexical_caststd::string(myNumericVar)).c_str()
It is a good idea?
Using a *const char ** is prone to Undefined Behaviors. If there's a way to use *std::string *instead, then try to do that. But - if you *must *use a *const char ** [say for a 3rd party interface that requires it] then that's as good as any method. Be aware of the potential for an exception, and be ready to deal with it.