[問題] 再次關於字串的問題
開發平台(Platform): (Ex: VC++, Gcc, Linux, ...)
Dev_C++
問題(Question):
根據love大提供的code
小妹我改了將txt黨讀入buf之後
發現不管pattern輸入多少字元
而target的字元數目大小超過7時
程式就無法執行了
餵入的資料(Input):
自txt檔讀入的英文文章:
The oil decision not to allow exploratory oil drilling.
CASE1:
Input pattern:oil(假設文章中有這個單字)
toInsert word:abcdefg(7個時沒有error)
CASE2:
Input pattern:oil
toInsert word:abcdefgh(當輸入8個時則會產生錯誤@@')
預期的正確結果(Expected Output):
CASE1:
The abcdefg decision not to allow exploratory abcdefg drilling
CASE2:
The abcdefgh decision not to allow exploratory abcdefgh drilling
錯誤結果(Wrong Output):
CASE2:
執行程式打入資料後會沒有回應@@"
程式碼(Code): (請善用置底文標色功能)
http://codepad.org/aaZin
補充說明(Supplement):
麻煩大家多多多幫忙了> <
謝謝~~=ˇ=
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.26.20.241
→
12/21 00:22, , 1F
12/21 00:22, 1F
→
12/21 00:27, , 2F
12/21 00:27, 2F
→
12/21 00:27, , 3F
12/21 00:27, 3F
→
12/21 00:30, , 4F
12/21 00:30, 4F
→
12/21 00:31, , 5F
12/21 00:31, 5F
→
12/21 00:49, , 6F
12/21 00:49, 6F
推
12/21 00:50, , 7F
12/21 00:50, 7F
→
12/21 00:53, , 8F
12/21 00:53, 8F
※ 編輯: haruhi6 來自: 114.26.16.153 (12/21 00:56)
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章