Just have a quick question. I\'ve looked around the internet quite a bit and I\'ve found a few solutions but none of them have worked yet. Looking at converting a string to
What about Boost.Lexical_cast?
Here is their example:
The following example treats command line arguments as a sequence of numeric data:
int main(int argc, char * argv[])
{
using boost::lexical_cast;
using boost::bad_lexical_cast;
std::vector args;
while(*++argv)
{
try
{
args.push_back(lexical_cast(*argv));
}
catch(bad_lexical_cast &)
{
args.push_back(0);
}
}
...
}