the code is working fine for an array of size 10^5
but, gives an error "/bin/run.sh: line 4: 21 Segmentation fault (core dumped) ./exe " when i make the array of size 10^6.
why?
Prime Visits - Prime Sieve Problem
Chack now.
If you make it global, maximum allowable size increases upto order 10^7.
If you declare it in the main, then it would be of order 10^5
okk… what if i have to make it of size even more then 10^7
int n = 1000000;
int a[n];
int b[1000000];
is there any difference between the two arrays?
If size is more than 10^7, it will give segmentation fault because you cannot make an integer array of size > 10^7.
No the 2 arrays are similar.