array size

how to aalocate memmory for array of size 1 crore??

You can declare the array globally. Sample Code.


int a[10000000]={0}; i think this will work.

instead of declaring an array you can make use of arraylist as declaring such a big array would consume more than your system’s memory. therefore use arraylist . you can google it to know how to use it.

1 Like

I am not sure with the thing which you are saying Gagan. We should wait for the correct answer. in fact mine is also not correct as i checked it but it didn’t worked. upvote to you for giving your suggestion. thank you

You are saying that array ist consumes lower memory?

@vinayawsm is correct

okay thank you @betlista . you are really helpful sir. :slight_smile: