title: Declaring arrays inside an if statement
body: <pre><code>#include &lt;stdio.h&gt;
  
  int main(){
      char x;
  
      printf("enter something ");
      scanf("%c",&amp;x);
  
      if(x == 's') char y[] = "sauve";
  
      else char y[] = "hi"
  
      printf("%s",y);
      getch();
  }
  </code></pre>
  
  <p>It says "y" is not declared first. I'm new to arrays. What I want to do is display the string "suave" when the user inputs letter s.</p>