title: Error: Segmentation Fault 11 in Palindrome
body: <p>So I have been trying to make sure that I can check whether an user-inputted word is a palindrome or not by using function prototypes. However, I am getting an error in the end saying "Segment Fault: 11". I am fairly new to using function prototypes so if anyone can help me with solving anything that can be going on in the body of the function definition, then please point it out to me. </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void palindrome_check(int ch_length, char text)
  
  int main(void)
  {
      int length;
      printf("Enter how many characters are in the message: ");
      scanf("%d", &amp;length);
  
      char m;
      printf("Enter the message: ");
      scanf("%c", &amp;text);
  
      palindrome_check(l, m);
  
      return 0;
  }
  
  void palindrome_check(int ch_length, char text)
  {
      char msg[ch_length];
      text = msg[ch_length];
  
      int count = 0;
  
      while (count &lt; ch_length)
      {
          count++;
          scanf("%c", &amp;msg[count]);
      }
  
      int i, j;
      for (i = 0; i &lt; ch_length; i++)
      {
          msg[j] = msg[ch_length - i];
      }
  
      if (text[i] == text[j])
      {
          printf("The message you entered is a palindrome!\n");
      }
      else
      {
          printf("It's not a palindrome.\n");
      }
  }
  </code></pre>