Solved

file size limitation?

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

808 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