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

 Page 1 of 1 [ 5 post ]

Relevant Pages