// C10_10.cpp : Defines the entry point for the console application. // 讀取檔案資料至檔尾 #include "stdafx.h" #include #include int main(int argc, char* argv[]) { ifstream File1; // 準備讀取資料 int Data_ID=0; char Data[200]; File1.open("File1.txt"); if(!File1.is_open()) { cout<< "***檔案開啟失敗!" << endl; } else { while(!File1.eof()) { File1.getline(Data,sizeof(Data)); Data_ID++; cout << "列" << Data_ID << " : " << Data << endl; } } File1.close(); return 0; }