[問題] 將index結果存回檔案
開發平台(Platform): (Ex: VC++, Gcc, Linux, ...)
Dev_C++
問題(Question):
之前小妹友請教一下關於index的問題,目前已經更改成自檔案讀入,
只是目前想把結果存到文字檔中,不知如何下手
餵入的資料(Input):
自檔案讀入buf的文章為:
Recent technelogy advances in mobile networking have ushered in a new era of
persenal conmunication.
預期的正確結果(Expected Output):
在一個文字檔(index.txt)中,存著這些結果:
R 開頭的字有 :
Recent, 位置在 : 0,
........
u 開頭的字有 :
ushered, 位置在 : 53,
程式碼(Code): (請善用置底文標色功能)
http://codepad.org/SBxHOHH6m
補充說明(Supplement):
關於存檔案目前只知道更改buf可以自buf存入index.txt的方式而已
將buf存回到 檔案 D:/string.txt or C:/string.txt
FILE* fp1 = fopen(“D:/string.txt”,”w”);
fprintf(fp1, “%s”, buf);
fclose();
請大家多多幫忙小妹了> <
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.252.152.90
推
01/07 02:52, , 1F
01/07 02:52, 1F
→
01/07 13:08, , 2F
01/07 13:08, 2F
→
01/07 15:46, , 3F
01/07 15:46, 3F
→
01/07 15:46, , 4F
01/07 15:46, 4F
※ 編輯: haruhi6 來自: 111.252.152.88 (01/07 18:06)
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章
11
38