Memories and large dimention arrays!!!!! 
Author Message
 Memories and large dimention arrays!!!!!

C FAQ.
--
Hypertext C-FAQ: http://www.*-*-*.com/ ~scs/C-faq/top.html
C-FAQ ftp: ftp://rtfm.mit.edu, C-FAQ Book: ISBN 0-201-84519-9
Try "C Programming: A Modern Approach" ISBN 0-393-96945-2
Want Software?  Algorithms?  Pubs? http://www.*-*-*.com/



Mon, 13 Nov 2000 03:00:00 GMT  
 Memories and large dimention arrays!!!!!

Can anyone help me to solve this problem:

I need to work on matrix of size 512x512, it is not possible to just
define:

  int matrix[512][512];

because at compilation, an error will be generated:

"array size too large".

But by allocation for some memory, the problem can be solve!.
Like:

  matrix = malloc(**matrix*512*sizeof(int));

and so on!. Can you show me how?

Thank you for any little help.
Shaban



Tue, 14 Nov 2000 03:00:00 GMT  
 Memories and large dimention arrays!!!!!

Try

int (*matrix)[ 512 ];
matrix = malloc( 512L * 512L * sizeof (int) );

You'll have to determine if your platform can handle this.

--
Increase the Peace!
Charles LaCour

Quote:

>Can anyone help me to solve this problem:

>I need to work on matrix of size 512x512, it is not possible to just
>define:

>  int matrix[512][512];

>because at compilation, an error will be generated:

>"array size too large".

>But by allocation for some memory, the problem can be solve!.
>Like:

>  matrix = malloc(**matrix*512*sizeof(int));

>and so on!. Can you show me how?

>Thank you for any little help.
>Shaban



Tue, 14 Nov 2000 03:00:00 GMT  
 Memories and large dimention arrays!!!!!

On Fri, 29 May 1998 15:06:02 GMT, "Charles LaCour"

Quote:

>Try

>int (*matrix)[ 512 ];
>matrix = malloc( 512L * 512L * sizeof (int) );

>You'll have to determine if your platform can handle this.

This is probably not the way to solve this.
Check out faq 7.16 and 19.23

Quote:
>>I need to work on matrix of size 512x512, it is not possible to just
>>define:

>>  int matrix[512][512];

>>because at compilation, an error will be generated:

>>"array size too large".

Al Bowers                                
Tampa, FL

http://www.gate.net/~abowers/index.html


Wed, 15 Nov 2000 03:00:00 GMT  
 Memories and large dimention arrays!!!!!

I see your point.  Thank you.

--
Increase the Peace!
Charles LaCour

Quote:

>On Fri, 29 May 1998 15:06:02 GMT, "Charles LaCour"

>>Try

>>int (*matrix)[ 512 ];
>>matrix = malloc( 512L * 512L * sizeof (int) );

>>You'll have to determine if your platform can handle this.

>This is probably not the way to solve this.
>Check out faq 7.16 and 19.23

>>>I need to work on matrix of size 512x512, it is not possible to just
>>>define:

>>>  int matrix[512][512];

>>>because at compilation, an error will be generated:

>>>"array size too large".

>Al Bowers
>Tampa, FL

>http://www.gate.net/~abowers/index.html



Mon, 20 Nov 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Multi-dimentioned arrays -- computing the dimention

2. help with multi-dimention array

3. array and malloc ?(very large memory)

4. Memory question (Large Arrays)

5. A problem with very large arrays and memory in DOS-based C

6. Memory layout for large memory model VC++ 1.52

7. Help !!! Concat small array into large array

8. Arrays [256][256] --- error Array size too large!

9. BTW: How to get screen dimention? :-)

10. How to allocate memory larger 4GB ?

11. dynamic allocation of large amount of memory

12. allocation very large memory ?

 

 
Powered by phpBB® Forum Software