![]() |
LIMITS to array of structures.
Dear all i used the following code to store data in array of structures (struct items item[]) but when the array size becomes > 5990 the program terminates unexpectedly. can you please explain why?
Code:
#include <stdio.h> |
Re: LIMITS to array of structures.
You need a bigger stack, most likely. Better still, if you want to store that much data, use a linked list instead, which if written correctly should use the heap, which has far more space available. 5500*(100+10+100+10+100+4+8+15)=1.82MB, which is way too much to be trying to store on your stack.
|
| All times are GMT +5.5. The time now is 16:02. |