in the second loop of prime_sieve function in the video, why is long long int required instead of simple int. Why does int show a segmentation fault when the code is run?
void prime_sieve(int *p){
for(int i=3; i<=1000000; i+=2){
p[i] = 1;
}
//sieve
for(long long i=3; i<=1000000; i++){
if( p[i] ==1){
for(long long j=i*i; j<=1000000; j+=i){
p[j] = 0;
}
}
}
p[2]=1;
p[1] = p[0] =0;
}