title: Code crashing while allocating memory in the heap for holding the array of pointers to characters
body: <pre><code>#define MAX_STRING_SIZE 256
  
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  
  static void getList(char ***pppclist) 
  {
      int n=0;
      int i =0;
  
      printf("Enter the number of items in the List: ");
      scanf("%d", &amp;n);
  
      //Array of Pointers to characters
      *pppclist = (char **)malloc(n * sizeof(char *));  //X50, x51, x52
  
      for( i=0; i&lt;=n; i++)
      {
          *(pppclist[i]) = (char *)malloc(MAX_STRING_SIZE * sizeof(char)); //*X50 = X100
  
          printf("Enter the %d items in the List: ", i);
          scanf("%s", pppclist[i]);
      }
  
  }
  
  main(int argc, char *argv[])
  {
  
  
      char **ppclist = NULL; //array of Pointer to Pointer to character
  
      getList(&amp;ppclist); //X1
  
      printf("The Entered List is:%s", ppclist);
  
  
  
      for(;;);
  }
  </code></pre>
  
  <p>Hi all...Please help to debug the error in above program. I want to get a list of strings in get list function and print it in stack of main.I have allocated memory in the heap for holding the array of pointers to characters and characters.Some thing going wrong.Can any one help me?
  PS: Dont mark as duplicate</p>