19.磁盤文件的輸入。頭文件#include"fstream.h" //例題從156開始從156開始 &
1.打開文件:
a. fstream outfile;
outfile.open("f1.txt",ios::out);//其中fstream為系統對文件專用操作類從156開始 &
b. ofstream ostream("f1.txt");
ofstream ostrm; ostrm.open("f1.txt");//表示打開某個寫文件
c. ifstream istrm("f2.txt");defstream.h 例題
ifstream istrm; istrm.open("f2.txt");//表示打開某個讀文件
-----------------------------------------------------------------------
方式名 | 用途19.磁盤文件的輸入。頭文件#inclu
----------------------------------------------------------------------
in | 以輸入方式打開文件
-----------------------------------------------------------------------19.磁盤文件的輸入。頭文件#inclu
out | 以輸出方式打開文件
-----------------------------------------------------------------------
app | 以輸出追加方式打開文件defstream.h 例題