正在加载图片...
文件输入示例 include <fstream. h> oid main () ifstream fin ( TEST. TxT)i char line [100]; char name [50] int age float salary fin >> line i fin name age > salary i cout < line < endli c。吐t<<name<<""<<age<<""<< salary<<end1; f close()i 北大青鸟10 文件输入示例 #include <fstream.h> void main () { ifstream fin ("TEST.TXT"); char line [100]; char name [50]; int age; float salary; fin >> line ; fin >> name >> age >> salary; cout << line << endl; cout << name << " " << age << " " << salary << endl; fin. close(); }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有