Solved

file size limitation?

Posted on 1998-02-05
4
231 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
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.

856 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