我正在尝试将包含字符串的 treePtr->item.getInvest()
转换为整数。这可能吗?
最佳答案
如果您有权访问 boost:
int number= boost::lexical_cast<int>(treePtr->item.getInvest());
关于c++ - 将指针字符串转换为整数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1655904/