Re: memory problem
From: Dave Townsend (datownsend_at_comcast.net)
Date: 07/17/04
- Next message: Nolan Martin: "is a static functions address constant?"
- Previous message: Alf P. Steinbach: "Re: C++ guidance please!"
- In reply to: Sean Bartholomew: "memory problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 16 Jul 2004 18:27:05 -0700
Just a guess, but perhaps your stack doesn't allow you to have
27 megs of space ? Perhaps you can allocate buffer with the
free store instead ( like buffer = new char[27meg] )
"Sean Bartholomew" <adrian@rivaband.com> wrote in message
news:b8a337c3.0407161630.45bbe093@posting.google.com...
> size = myTextFile.tellg();
> myTextFile.seekg (0, ios::beg);
> char buffer[size+1];
> myTextFile.read (buffer, size);
> myTextFile.close();
> buffer[size] = '\0';
>
> the above code works great and always worked great.
> now, i tried to apply it to a 27MB text file instead of the 300K one
> it was used to doing and i get a fault exception. i am 99% positive
> its the size of the file. which makes sense. but my entire program
> depends of the buffer containing the entire text for searching and
> extraction and parsing purposes.
> is there a way around this where i could search direct from the drive
> instead of a buffer?
- Next message: Nolan Martin: "is a static functions address constant?"
- Previous message: Alf P. Steinbach: "Re: C++ guidance please!"
- In reply to: Sean Bartholomew: "memory problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|