看板 Programming 關於我們 聯絡資訊
阿? 當初我開始學的時候也常面臨到這種窘境 建議:P 因為字串長度已知且很短 所以直接暴力用存成另一個字串char stb[100]; sta = "0002"; for(int i=0, j=0; i<=length; ++i){ if(sta[i] != 0) stb[j++] = sta[i]; if (j>99) cout<<"stb is overflow"<<endl; } //天氣好熱歐... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.124.156.25