dcsimg
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: C++
Expertise: Beginner
Nov 7, 2000

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Maximum Number of Characters

Question:
I'm reading approximately two million characters into an array. The max number of elements that Borland Turbo C++ 5.02 allows me is not enough. Can I declare this array to be a lot bigger or allocate more memory for this array?

Answer:
The maximal possible size of an array depends on the OS you're using and the compiler's setting. If it's DOS, you can't allocate such a huge array on the stack, and even dynamic allocation might not succeed. The workaround is to split the array into smaller sub-arrays, each occupying 64k or so, and swap them into a disk file (modern operating systems do that automatically but DOS doesn't). Alternatively, you can redesign your application so that it uses a smaller data structure.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date