[問題] 去除多餘字元和轉換大小寫(已解決)
開發平台(Platform): (Ex: VC++, Gcc, Linux, ...)
Dev_C++
問題(Question):
Q1:去除多餘的空白
Q2:將每個句子首字母大寫
餵入的資料(Input):
自檔案讀入文章,內容如下:(不斷行)
users can ubiquitously access the data via many emerging mobilo appliances, such as portable notebooks, personal digital assistants (PDAs), and WAP-enabled cellalar phones. recent technelogy advances in mobile networking have ushered in a new era of persenal conmunication.
預期的正確結果(Expected Output):
Users can ubiquitously access the data via many emerging mobilo appliances, such as portable notebooks, personal digital assistants (PDAs), and WAP-enabled cellalar phones. Recent technelogy advances in mobile networking have ushered in a new era of persenal conmunication.
錯誤結果(Wrong Output):
Q1:出現停止運作,但是一兩次會出現正常結果
Q2:一樣會有停止運作
程式碼(Code): (請善用置底文標色功能)
Q1:http://codepad.org/utde7LiZh
Q2:http://codepad.org/Nez9uFmh8
補充說明(Supplement):
小妹我在Q1部分只寫了將三個空白取代成一個,想說如果成功了就可以陸續加入四個空白
取代成一個之類,打算用寫好的方式@@"
在Q2部分,我先用exactMatch函數尋找". ",將之後的字轉成大寫,為測試有沒有成功
在印出結果的buf前有令他顯示,有看到成功...
然後兩個程式碼都會出現停止運作...是不是在記憶體配置上有錯誤呢@@?
請大家多多指教>"<
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.252.152.90
推
01/07 01:21, , 1F
01/07 01:21, 1F
→
01/07 01:22, , 2F
01/07 01:22, 2F
→
01/07 01:23, , 3F
01/07 01:23, 3F
→
01/07 01:35, , 4F
01/07 01:35, 4F
→
01/07 01:37, , 5F
01/07 01:37, 5F
→
01/07 01:37, , 6F
01/07 01:37, 6F
→
01/07 01:40, , 7F
01/07 01:40, 7F
→
01/07 01:40, , 8F
01/07 01:40, 8F
→
01/07 01:43, , 9F
01/07 01:43, 9F
推
01/07 01:47, , 10F
01/07 01:47, 10F
→
01/07 01:48, , 11F
01/07 01:48, 11F
※ 編輯: haruhi6 來自: 111.252.152.90 (01/07 01:53)
推
01/07 02:01, , 12F
01/07 02:01, 12F
→
01/07 02:08, , 13F
01/07 02:08, 13F
→
01/07 02:08, , 14F
01/07 02:08, 14F
推
01/07 02:12, , 15F
01/07 02:12, 15F
→
01/07 02:15, , 16F
01/07 02:15, 16F
→
01/07 02:39, , 17F
01/07 02:39, 17F
※ 編輯: haruhi6 來自: 111.252.152.88 (01/07 18:08)
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章
11
38