Solved

Array size

Posted on 1998-08-16
3
176 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
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 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.

743 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

10 Experts available now in Live!

Get 1:1 Help Now