Can anyone tell me why I'm getting runtime error sigsev in this code for the problem CLEANUP in practice easy section

#include
using namespace std;
class job
{
int n,m,j[1000],chef[1000],assist[1000],c,a;
public:
void in_process()
{
cin>>n>>m;
for(int i=0;i<n;i++)
{
j[i]=1;
}
for(int i=0;i<m;i++)
{
int tem;
cin>>tem;
j[tem]=0;
}
int l=0,k=0;
for(int i=0;i<n;i++)
{
while(j[i]==0)
i++;
chef[l++]=i++;
while(j[i]==0)
i++;
assist[k++]=i;
}
c=l;
a=k;
}
void out()
{
if(c==0)
cout<<" “;
else
for(int i=0;i<c;i++)
cout<<chef[i]<<” “;
cout<<endl;
if(a==0)
cout<<” “;
else
for(int i=0;i<a;i++)
cout<<assist[i]<<” ";
cout<<endl;

}

};
int main()
{
int t;
cin>>t;
job j[t];
for(int i=0;i<t;i++)
j[t].in_process();
for(int i=0;i<t;i++)
j[t].out();
return 0;
}

Your main function looks like:

int main()
{
   int t;
   cin >> t;

   job j[t];

   for (i=0; i<t; i++)
      j[t].in_process();

   for (i=0; i<t; i++)
      j[t].out();

   return 0;
}

Should be using j[i].

A debugger would probably have pointed to this. Could you learn to use gdb?