title: runtime error (SIGSEGV)
body: <pre><code>#include&lt;iostream&gt;
  #include&lt;string&gt;
  using namespace std;
  int main()
  {
     char arr[1000][80];
     char output[1000][80];
     int n,i,j;
     int num[1000];
     cin&gt;&gt;n;
     for(i=0;i&lt;n;i++)
     {
      cin&gt;&gt;num[i];
        cin&gt;&gt;arr[i];
     }
     for(i=0;i&lt;n;i++)
     {
        for(j=(num[i]-1);j&lt;(strlen(arr[i])-1);j++)
        {
          arr[i][j]=arr[i][j+1];
        }
        arr[i][j]='\0';
        cout&lt;&lt;"\n"&lt;&lt;(i+1)&lt;&lt;" "&lt;&lt;arr[i];
     }
    return 0;
  }
  </code></pre>
  
  <p>This is the code which while uploading on Spoj gives the above error. The same code runs fine on Borland C++.</p>