// Array example for cs 149, spring 2004 #include #include int main () { const int N=100; int InCt; double X[N]; fstream Data; // Load Array & report number read. Data.open ("Data.txt", ios::in); InCt = 0; while ( Data >> X[InCt] ) { InCt++; } Data.close(); cout << InCt << " values read from file." << endl << endl; // Print contents of array in reverse order. for (int i=InCt-1; i>=0; i--) cout << X[i] << endl; return 0; }