C++學習筆記:IO操作

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 的教材

 

Input/Output with files

 

File I/O in C++ : part 1 of 2

File I/O in C++ : part 2 of 2

 

主要的函數

 

open()

close()

is_open()

 

rdstate()

clear()

 

 

get()

put()

read()

write()

getline()

 

flush()

 

seekp() / seekg()

tellp() / tellg()

ignore()

 

putback()

peek()

 

對流格式的控制

通過Manipulator 實現,比C語言中的format string 更方便使用。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章