I am having a text file containing 65536 integers. I am writing a C++ program given at below to read this file. But it is not working properly. It is working well for text file with few integers. But not working properly for large file.
#include(iostream)
#include(fstream)
using namespace std;
int main() {
ifstream myReadFile;
myReadFile.open("FileName.txt");
char output[1000];
if (myReadFile.is_open()) {
while (!myReadFile.eof()) {
myReadFile >> output;
cout<<output;
}
}
myReadFile.close();
system("pause");
return 0;
}
Please suggest the Solution.