Re: [問題] 二維陣列如何存入.txt檔
string pos_table[120][5];
for(i=0;i<120;i++){
for(int j=0;j<5;j++){
fprintf(fptr, "%d,",pos_table[i][j].c_str());
}
}
→
12/27 21:07,
12/27 21:07
→ arno855268:int pos_table[120][5]={-1}; 12/27 21:07
所以你定義了兩個 pos_table 嗎?
可是你的迴圈裡永遠只看得到上面紅色的 string pos_table[120][5]
而看不到你全域的 int pos_table[120][5] 喔...
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.117.171.46
推
12/27 21:20, , 1F
12/27 21:20, 1F
→
12/27 21:20, , 2F
12/27 21:20, 2F
→
12/27 21:20, , 3F
12/27 21:20, 3F
討論串 (同標題文章)
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章
13
22