寫文本文件
本示例使用流寫文本文件
#包括<iostream.h>
#包括<fstream.h>
詮釋的Main ( )
(
/ /首先讓輸出到一個文件
ofstream fout ( “ sample.txt ” ) ;
fout “ ” “ programmershelp ” “ ” endl ;
fout.close ( ) ;
焦海峽[ 20 ] ;
/ /讀取該文件中
ifstream魚翅( “ sample.txt ” ) ;
魚翅“ ”海峽;
fin.close ( ) ;
/ /顯示sample.txt內容
法院“ ” “數據讀取文件: ” “ ”海峽“ ” endl ;
返回0 ;
)
相關帖子:
- cppoctdechex 八/十六進制/十進制轉換#包括<iostream.h> #包括<iomanip.h> ...
- 顯示CSV文件 顯示CSV文件中是常見的CSV文件格式, ...
有關職位為您帶來的另一種相關文章插件 。



















































發表評論