string to int

来源:互联网 发布:coc迫击炮升级数据 编辑:程序博客网 时间:2024/06/06 14:26
#include <iostream>
11 #include <string>
12 #include <cstdlib>
13 
14 using namespace std;
15 
16 int main() {
17   string s = "123";
18   double n = atof(s.c_str());
19   //int n = atoi(s.c_str());
20   
21   cout << n << endl;

22 }

---摘自 http://www.cnblogs.com/oomusou/archive/2006/10/10/525647.html

0 0
原创粉丝点击