Prime sieve - error in video in declaring globally

Why cant we declare int n; int p[n+1] globally ?
in the video you tired doing but it showed an error.

hey @Anchal, the problem is with int N=1000000. If you use #define N 1000000. It will work fine.