title: How to find a character in a sentence C language
body: <p>I am having trouble with my code being new to C.  I am simply trying to get this program to print the index where string[j] = "a".  If I take out the if statement, the program will flawlessly print out all the index positions, but it doesn't work with the if statement.  It is very simple for me to do this in other languages.  How do you achieve this in C?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  int main(int argc, char **argv) {
      char string[100] = "Smart Guy";
  
      for(int j = 0; j &lt; strlen(string); j++) {
          if (string[j] == "a") {
              printf("%d %c\n", j, string[j]);
          }
      }
  
      return 0;
  }
  </code></pre>