0

I've opened a text file in Visual Studio 2010, with size 500 MB (8 million line) and read it without problems.

But when I tried to open another file with size 54 MB (2.5 million line), its failed and give a stack overflow exception!

Why this although file 2 is smaller? EDIT:

void main()
{
   string line;
   ifstream inputfile1;
   inputfile1.open("file1.txt");

   while(!inputfile1.eof())
   {
       getline(inputfile1,line);
   }
}
userInThisWorld
  • 1,133
  • 3
  • 17
  • 31

0 Answers0