Solved

file size limitation?

Posted on 1998-02-05
4
209 Views
Last Modified: 2010-04-10
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?
0
Comment
Question by:learn
  • 2
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 40 total points
ID: 1180726
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
 

Author Comment

by:learn
ID: 1180727
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
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1180728
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
 

Author Comment

by:learn
ID: 1180729
Sorry, I haven't got time to read the site.
Thank you for your help.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now