C++學習筆記:IO操作
2009-5-13
I/O相關的類
ios
-->istream, ostream, iostream
-->ifstream, ofstream, fstream; istringstream, ostringstream, iostringstream
streambuf
--> filebuf, stringbuf
一個不錯的C++在線參考網站http://www.cplusplus.com/
這裏提供了I/O相關類的關係圖
。
File I/O 的教材
主要的函數
open()
close()
is_open()
rdstate()
clear()
get()
put()
read()
write()
getline()
flush()
seekp() / seekg()
tellp() / tellg()
ignore()
putback()
peek()
對流格式的控制
通過Manipulator
實現,比C語言中的format string 更方便使用。