[問題] c_str未宣告???
現在想要把一個string轉成int
找了一下決定用一下的方法
int temp=atoi(code.c_str());
有include string這個檔案了 可是在編譯的時候跑出'c_str' has not been declared
request for member of non-aggregate type before '(' token
請問一下我是少include什麼檔案嗎
貼上比較完整的
int i;
string **codenumber = new string*[26000];//指定二維陣列
for( int i=0 ; i <26000 ; i++ )
{codenumber[i]=new string[1];}
while(!inStream.eof())
{
int temp=atoi(*codenumber[i].c_str());//此行一直有問題
i++;
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 134.208.33.70
→
03/15 23:12, , 1F
03/15 23:12, 1F
→
03/15 23:26, , 2F
03/15 23:26, 2F
推
03/15 23:38, , 3F
03/15 23:38, 3F
→
03/15 23:42, , 4F
03/15 23:42, 4F
→
03/15 23:48, , 5F
03/15 23:48, 5F
→
03/15 23:48, , 6F
03/15 23:48, 6F
※ 編輯: cophie 來自: 134.208.33.70 (03/15 23:53)
※ 編輯: cophie 來自: 134.208.33.70 (03/15 23:54)
推
03/16 00:06, , 7F
03/16 00:06, 7F
→
03/16 00:07, , 8F
03/16 00:07, 8F
→
03/16 00:28, , 9F
03/16 00:28, 9F
推
03/16 16:55, , 10F
03/16 16:55, 10F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章