i have tried like that int arr[1000000] to initialize but it crashed my programm.but if i do int arr[100000] it works fine..why is that and what is the maximum range of integer array initialization??
Assuming an int is 4 bytes, that's approximately 3.8 Megabytes.
In Visual Studio, I believe the stack size is 1 MB by default, and on other implementations it goes up to 4 MB. However, all compilers provide settings to change the default stack size I believe.
But, you wouldn't have this problem to begin with if you used dynamic (heap) memory instead.