file size limitation?

Using ifstream file("the file"), I tried to search something in the file (.txt). When the size of the file is bigger than 30K something very wrong will happen.

Is this limitation set by C++ or is based on the memory of the PC or something I don't know?
learnAsked:
Who is Participating?
 
Tommy HuiConnect With a Mentor EngineerCommented:
More likely, it is something in your program. There is no file size limitation. If you want, you can post the main loop of your program and we can try to figure out what's wrong.
0
 
learnAuthor Commented:
Hi you are 100% right!
After reading your comment, I tried to reduce my code for posting. When the code became simpler, I found the bug: some of the arrays not big enough :-) After increas the size of the arrays, the code just runs fine. Thank you for your help.

btw. how to avoid such mistake? Can C++ check that for us?
0
 
Tommy HuiEngineerCommented:
If I answered your question, you should grade the answer. C++ can check if you create a class that does that. However, there's no built-in support for that due to efficiency.
0
 
learnAuthor Commented:
Sorry, I haven't got time to read the site.
Thank you for your help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.