What is the problem with this approach if i initialise all the elements as prime

#include<bits/stdc++.h>
using namespace std;
int p[100000]={0},n;

void t p[]){
p[0]=p[1]=0;
for(int i=2;i<=100000;i++)
p[i]=1;
for(int i=2;i<=100000;i++)
if(p[i]==1)
for(int j=i*i;j<=100000;j+=i){
p[j]=0;
}

}

int main(){

 cin>>n;
 prime_seive(p);
  for(int i=0;i<=n;i++){
      if(p[i]==1)
      cout<<i<<",";
        }
  return 0; 

}

hi @bksingh07888

this should be single equal to

p[i]=1

if you have more doubts regarding this feel free to ask
and if your doubt is resolved please mark it as resolved from your doubt section in your course

still not working…how to solve it?

save your code at https://ide.codingblocks.com/
and send the link generated

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.