正在加载图片...
上海交通大学交大密西根 ·联合学院一 181 UM-SJTU Joint Institute University of Michigan Shanghal Jiao Tong University Example for File Input #include <iostream> #include <Fstream> using namespace std; int main(void) ifstream inFile;/Create an input file object char fileName[26];/1D array of chars string name; Float score; cout <"What filename do you want to read from:" cin >fileName; inFile-open(fileName);//Connect the stream to the file if (!inFile.fail()) while (!infile.eof ()infile >name >score; cout <"End of input detected\n"; inFile.close();//Disconnect the stream from the file return 8;Example for File Input Example for File Input
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有