upper limit for an array
-
What is an upper limit for dynamic allocation of single array? For an example: int* A_of_int = new int[X]; What is upper value for X. The environment is visual studio 6 on windows platform (XP). I suppose one of the limits is memory size.
-
What is an upper limit for dynamic allocation of single array? For an example: int* A_of_int = new int[X]; What is upper value for X. The environment is visual studio 6 on windows platform (XP). I suppose one of the limits is memory size.
INT_MAX And of course avaliable memory. - Anders Money talks, but all mine ever says is "Goodbye!" ShotKeeper, my Photo Album / Organizer Application [^]
-
INT_MAX And of course avaliable memory. - Anders Money talks, but all mine ever says is "Goodbye!" ShotKeeper, my Photo Album / Organizer Application [^]
Hi Perhaps I'm wrong but INT_MAX is defined as maximum int value 2^31-1 What I need is maximum array size for type int Is constant INT_MAX also used to define maximum array size for type int? Tomaz Rotovnik
-
Hi Perhaps I'm wrong but INT_MAX is defined as maximum int value 2^31-1 What I need is maximum array size for type int Is constant INT_MAX also used to define maximum array size for type int? Tomaz Rotovnik
In reallity the avaliable memory is the only limit, as an array is just a pointer to some memory. Why do you need this limit? - Anders Money talks, but all mine ever says is "Goodbye!" ShotKeeper, my Photo Album / Organizer Application [^]
-
In reallity the avaliable memory is the only limit, as an array is just a pointer to some memory. Why do you need this limit? - Anders Money talks, but all mine ever says is "Goodbye!" ShotKeeper, my Photo Album / Organizer Application [^]
I need an huge array and I want prevent application crash. I think I found the answer: max heap size is declared in malloc.h /* Maximum heap request the heap manager will attempt */ #define _HEAP_MAXREQ 0xFFFFFFE0 Tomaz Rotovnik
-
I need an huge array and I want prevent application crash. I think I found the answer: max heap size is declared in malloc.h /* Maximum heap request the heap manager will attempt */ #define _HEAP_MAXREQ 0xFFFFFFE0 Tomaz Rotovnik
Tomaz Rotovnik wrote: #define _HEAP_MAXREQ 0xFFFFFFE0 That is 4GB, a lot more memory that most computers have... If you use malloc to alloc your array, the app will not crash, but you will get a NULL pointer if it fails. - Anders Money talks, but all mine ever says is "Goodbye!" ShotKeeper, my Photo Album / Organizer Application [^]
-
Tomaz Rotovnik wrote: #define _HEAP_MAXREQ 0xFFFFFFE0 That is 4GB, a lot more memory that most computers have... If you use malloc to alloc your array, the app will not crash, but you will get a NULL pointer if it fails. - Anders Money talks, but all mine ever says is "Goodbye!" ShotKeeper, my Photo Album / Organizer Application [^]
Anders Molin wrote: That is 4GB, a lot more memory that most computers have... Even if the computer had 8GB of RAM, the memory manager only allows each process 2GB for its address space, or 3GB if the /3GB startup switch were used. Anders Molin wrote: ...if it fails. That should be "when it fails."
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen