<分区>
Possible Duplicate:
convert string to integer in c++
转换一个编号。从字符串到整数。
例如:str:"1234" 转换为 int a=1234;
我想要有适当解释的提示
标签 c++
<分区>
Possible Duplicate:
convert string to integer in c++
转换一个编号。从字符串到整数。
例如:str:"1234" 转换为 int a=1234;
我想要有适当解释的提示
最佳答案
使用atoi()
:
int foo = atoi(str.c_str());
关于c++ - 转换一个没有。从字符串到整数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5289671/