達克魔部落
隨筆寫寫!! 歡迎一起討論
2011年5月21日 星期六
[C++] String變數使用atoi函式
在寫程式的時候遇到這個問題
因為atoi函式只吃char*
上網GOOGLE一下找到了解決之法
string x;
int temp=atoi(x.c_str());
c_str()可以轉換string成為char*
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言