string buffer; fstream fs("a.txt"); fs >> buffer;. 就這樣搞定。容易吧,直接一個箭頭就可以把檔案內容推到string 裡面去了,只是基stream 的關係 ...
確定! 回上一頁