Prime sieve problem

what is wrong in this, i am not optimising it for now.

void primeseive(long long int p[1000000],long long int N)
{
p[0]=p[1]=0;
p[2]=1;
for(long long int i=3;i<N;i=i+2)
{
p[i]=1;
}
for(long long int i=3;i<N;i=i+2)
{
if(p[i])
{
for(long long int j=ii;j<N;j=j+2i)
{
p[j]=0;
}
}
}
return;
}

This is the optimised code.