title: Why if else statements are not working for an array?
body: <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      char array[2][2] = {&quot;-&quot;, &quot;+&quot;};
      printf(&quot;%s&quot;, array[0]);
      
      if(array[0] == &quot;-&quot;){
          printf(&quot;Its a minus/n&quot;);
      }
      else{
          printf(&quot;\nNothing&quot;);
      }
      
      return 0;
  }
  </code></pre>
  <p>Every time I run the code, only else gets executed.
  I have explicitly mentioned that if 0th index of array is equal to a string minus then print <strong>its a minus</strong>.</p>
  <p>I have declared <code>char array[2][2]</code> character array.
  Stored only one element in it regardless of limit being of 2 elements.
  And I am calling <code>array[0]</code> because I want only first character.</p>
  <pre><code>
  if(array[0] == &quot;-&quot;){
      printf(&quot;Its a minus/n&quot;);
  }
  else{
      printf(&quot;\nNothing&quot;);
  }
  
  </code></pre>
  <p>Does anyone has a solution for it?</p>