title: Segmentation fault (core dumped) in C in Linux
body: <p>I'm trying to run this program by taking input from the user and I'm getting a <strong><em>Segmentation fault (core dumped)</em></strong> error. Can anyone help me to find out why this error is occurring and how can I fix this error? My code is given below:</p>
  
  <pre><code>// C program to remove the occurrences of a specific char from the given string.
  
  #include &lt;stdio.h&gt;
  
  char *squeeze(char *a[], int b){
  
      int i,j;
  
      for(i=j=0; *(*a+i)='\0';i++){
  
         if(*(*a+i)!=b)
             *(*a+j++)=*(*a+i);
      }
      *(*a+j)='\0';
  
      return *a;
  }
  
  void main(){
  
      char *c[1];
      char d[2];
      int e;
  
      printf("Enter the string: ");
      scanf("%s",*c);
      printf("Enter the character to delete: ");
      scanf("%c",d);
      e=d[0];
  
      printf("Resulting string is:%s.\n",squeeze(c,e));
  }
  </code></pre>