我是初学者,需要解释为什么这不起作用:
string myArray[620223];
//myArray is then populated with a while loop using ifstream and getline
string myString = myArray[9];
double myValue;
try {
myValue = boost::lexical_cast<double>(myString);
}
catch(boost::bad_lexical_cast const&) {
myValue = 0;
}
myArray[9] 不为零,但结果双精度始终为零。任何帮助将不胜感激。谢谢你。