473,386 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Array of a big order

Dear Sir:
I would like to know how can I define a big array, for example

float *x;
x = (float *)malloc(25000*25000*sizeof(float*));

There is a problem when i try to access elements of this array.

There is not problem when size is lower, for example 1000 x 1000.

I need this definition for image processing

Thank you for your help
Feb 16 '12 #1
2 1454
weaknessforcats
9,208 Expert Mod 8TB
THere may be limits on your CRT heap size. You don't say what OS you are using. You will need 625 million float* and id your OS is 32 bit that would be 2500 million bytes or 2.5 gigabytes.

The Windows address space is 2G.

You are going to have to use a different algorithm that will involve files in addition to memory. I suggest you look at a database engine that can work wit large tables. Maybe Oracle if you are using Unix. Maybe SQL Server if you are using Windows.
Feb 16 '12 #2
donbock
2,426 Expert 2GB
You want to be careful to test the return value from malloc. If malloc returns NULL then it was unable to allocate the memory.
Feb 16 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Steve | last post by:
I'm working on an e-commerce site, and one of the things I need to do is split an existing order into two orders. The problem I'm having is not creating the new order, but getting the remaining...
6
by: Belmin | last post by:
I have an array. The array key is the id of the item (for example categories, 91 is the ID of the category) all ID are not exactly in date order, but they're added to the array in date order, how...
4
by: its me | last post by:
Let's say I have a class of people... Public Class People Public Sex as String Public Age as int Public Name as string end class And I declare an array of this class...
19
by: Steven T. Hatton | last post by:
I believe it is technically possible to return a pointer to the first element of an array. I can persuade the returned pointer to act like an array, with some qualifications. I'm specifically...
9
by: Steven T. Hatton | last post by:
The following works: template <typename T> struct ID3M{ static const T ID; }; template <typename T> const T ID3M<T>::ID = {{1,0,0},{0,1,0},{0,0,1}};
9
by: JW | last post by:
Dear NG, Still working on my .NET CF C# forms application ... I have an array of forms that I wish to display in array order, and thus have created a loop to run through them. Due to...
2
by: christopherkilmer | last post by:
I've googled my brains out and haven't found the answer yet, so... I have a WebMethod that accepts an array of Order objects as a parameter. I cannot figure out how to send an array to the...
7
by: pauld | last post by:
Ive got a series of 2 dimensional associative arrays while(list($key, $val) = each ($results)) { {foreach($val as $i=>$v) print "$i = $v"; } } but i want to define the order that the...
8
by: per9000 | last post by:
Hi all, I have a two-dimensional array of data, f.x int's. We can imagine that the array is "really large". Now I want the data in it and store this in a one-dimensional array. The obvious...
6
by: mdburton | last post by:
$row = mysql_fetch_array(mysql_query("SELECT enemies FROM $tab WHERE id='$cid'")); $array = explode (",", $row); $crewupdate = mysql_query("SELECT id,name,founder FROM $tab WHERE id>0 AND...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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$) { } ...
0
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...
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.