What is the best way to store large arrays of numbers (eg, 4-byte
integers)?
Say I want to store an array of 1billion 4-byte integers.. If my
computer has 4gB memory, then is this possible?
int Large_Array[1000000000];
This will cause a "stack overflow" when i try and execute. How can I
do this? 3 2548
On Jan 28, 11:58*am, "Alf P. Steinbach" <al...@start.nowrote:
* hamishd:
What is the best way to store large arrays of numbers (eg, 4-byte
integers)?
Say I want to store an array of 1billion 4-byte integers.. If my
computer has 4gB memory, then is this possible?
Depends on the computer and C++ implementation.
int Large_Array[1000000000];
This will cause a "stack overflow" when i try and execute. How can I
do this?
You might try to allocate it dynamically, by using
* *std::vector<intLarge_Array( 1000000000 );
However, if you're skirting the limits of your computer's memory
capacity, then it's not a good idea even if it seems to work.
thanks.
You'd be better off using some disk-based structure, processing only
parts of it at a time.
What are the quicker ways of doing this?
why not use pointer instead of array?
On 1ÔÂ28ÈÕ, ÏÂÎç7ʱ38·Ö, hamishd <Hamish.D...@gmail.comwrote:
What is the best way to store large arrays of numbers (eg, 4-byte
integers)?
Say I want to store an array of 1billion 4-byte integers.. If my
computer has 4gB memory, then is this possible?
int Large_Array[1000000000];
This will cause a "stack overflow" when i try and execute. How can I
do this?
On Jan 28, 3:13*pm, "Alf P. Steinbach" <al...@start.nowrote:
* hamishd:
On Jan 28, 11:58 am, "Alf P. Steinbach" <al...@start.nowrote:
* hamishd:
>What is the best way to store large arrays of numbers (eg, 4-byte integers)? Say I want to store an array of 1billion 4-byte integers.. If my computer has 4gB memory, then is this possible?
Depends on the computer and C++ implementation.
>int Large_Array[1000000000]; This will cause a "stack overflow" when i try and execute. How can I do this?
You might try to allocate it dynamically, by using
* *std::vector<intLarge_Array( 1000000000 );
However, if you're skirting the limits of your computer's memory
capacity, then it's not a good idea even if it seems to work.
thanks.
You'd be better off using some disk-based structure, processing only
parts of it at a time.
What are the quicker ways of doing this?
Depends on what you're doing.
I'm storing the frequency that a value occurs (value ranging from 1..
a billion).
However.. I suspect the array maybe quite sparce. That is, not all
values will occur at all, so there may be a large number of zeroes. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Hayden Kirk |
last post by:
I've used PHP for many smaller projects, but now im embarking on large
corporate websites.
After reading this:
http://www.ukuug.org/events/linux2002/papers/html/php/index.html
PHP does not...
|
by: Nanda |
last post by:
hi,
I am trying to generate parameters for the updatecommand
at runtime.
this.oleDbDeleteCommand1.CommandText=cmdtext;
this.oleDbDeleteCommand1.Connection =this.oleDbConnection1;...
|
by: oswald.kluge |
last post by:
Dear Reader,
what efficient ways are there to OR two large memory regions?
I'm especially interested in applying this operation to two large
character arrays. I know memset and memcopy lets...
|
by: djhulme |
last post by:
Hi,
I'm using GCC. Please could you tell me, what is the maximum number of
array elements that I can create in C, i.e.
char* anArray = (char*) calloc( ??MAX?? , sizeof(char) ) ;
I've...
|
by: Peter Duniho |
last post by:
This is kind of a question about C# and kind of one about the framework.
Hopefully, there's an answer in there somewhere. :)
I'm curious about the status of 32-bit vs 64-bit in C# and the...
|
by: Dr Mephesto |
last post by:
Hi!
I would like to create a pretty big list of lists; a list 3,000,000
long, each entry containing 5 empty lists. My application will append
data each of the 5 sublists, so they will be of...
|
by: Aryan |
last post by:
Hi,
I am using C# with framework 2.0 and creating PDF files on-fly, along
with this I am using Windows 2003 Server.
I am using Byte to take the data input and then save into pdf format
on...
|
by: abunn |
last post by:
I've been learning Visual C++ on the fly at work for the last 2 weeks and could use some help. I'm writing a program to read a .raw file which has a standard format of 9 columns and then depending...
|
by: =?Utf-8?B?U3RldmVa?= |
last post by:
First off, I am not sure if this belongs in this group or the C# group. It
seems more like a C++ problem to me. Anyways...
I have a C# project which links in an unmanaged C++ DLL, both built...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |