テキストファイルを読み取って配列に保存しようとしていますが、プログラムが無限ループに陥り続けています。
これが私のコードです:
int main () {
const int size = 10000; //s = array size
int ID[size];
int count = 0; //loop counter
ifstream employees;
employees.open("Employees.txt");
while(count < size && employees >> ID[count]) {
count++;
}
employees.close(); //close the file
for(count = 0; count < size; count++) { // to display the array
cout << ID[count] << " ";
}
cout << endl;
}