Solved

Array size

Posted on 1998-08-16
3
177 Views
Last Modified: 2010-04-01
Hello friends,
                     I'm fixing my array size to 1 billion.Will the program works well?.
Is there is a maximum fixed size for the array size to be set?.
Thanxs in advance.
0
Comment
Question by:66
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
willemnel earned 0 total points
ID: 1170451
You can basically set your array size to any size you want, but you will be limited by your computer's memory. You must also remember that different types of arrays use different amounts of memory e.g. "char" uses 1 byte per element, "int" uses (depending on the compiler) 4 bytes etc. That means that if you want to declare an array of "char" with 1 billion (1000 000 000) elements, you'll need roughly 1000 MB of ram. Unless you got one serious PC, I don't think your program will work!
0
 
LVL 84

Expert Comment

by:ozo
ID: 1170452
It might still work if you have 1000 MB of swap space, but it could be slow.
If your addresses are limited to 32 bits, you would have another limit around 4 billion.
0
 
LVL 1

Expert Comment

by:willemnel
ID: 1170453
Ozo's right, of course. I was assuming that your talking about about "normal" circumstances where disk swapping is not used.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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…

910 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

22 Experts available now in Live!

Get 1:1 Help Now