正在加载图片...
上海交通大学交大密西根 联合学院·一 ◆ ■ 81T UM-SJTU Joint Institute University of Michigan Shanghal Jiao Tong University Reading from a file ·include<fstream> Declaration:ifstream inFile; Open and bundle it with a physical file on a disk: inFile.open ("InputData.dat"); Compiler will look for it from the same directory as the one where the project file resides. You can also use relative or absolute path: inFile.open("C:\leng101\hw\\hw6\hw6.dat");Reading from a file Reading from a file • #include <fstream> • Declaration: ifstream inFile; • Open and bundle it with a physical file on a disk: inFile.open (“InputData.dat"); Compiler will look for it from the same directory as the one where the project file resides. • You can also use relative or absolute path: inFile.open("C:\\eng101\\hw\\hw6\\hw6.dat");
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有