史萊姆論壇

史萊姆論壇 (http://forum.slime.com.tw/)
-   一般電腦疑難討論區 (http://forum.slime.com.tw/f17.html)
-   -   c++問題 要怎麼輸出txt檔呀 (http://forum.slime.com.tw/thread38108.html)

angelantre 2003-05-22 08:08 PM

c++問題 要怎麼輸出txt檔呀
 
這是程式碼↓
#include <string>
#include <fstream>

string a("");
string s;
int z;
int bb;
int i;
int main()
{
for (i=0;i<64;i++)
{
ifstream infile ("in.txt");
infile.seekg(i) >> s;
cout << s <<endl;
i=i+8;
}
}

為啥我讀取txt的內容
輸出到螢幕後
發現txt裡字串滴空白都沒輸出
請大大幫幫我吧~~~~☆

這是我txt裡的內容↓
aa
aaaa
aa aa
aaaaaaaa
aaaaaaaa
aa aa
aa aa

可是程式run過後~輸出卻變這樣.....↓
aa
aaaa
aa
aaaaaaaa
aaaaaaaa
aa
aa
aa


所有時間均為台北時間。現在的時間是 07:50 AM

Powered by vBulletin® 版本 3.6.8
版權所有 ©2000 - 2025, Jelsoft Enterprises Ltd.

『服務條款』

* 有問題不知道該怎麼解決嗎?請聯絡本站的系統管理員 *


SEO by vBSEO 3.6.1