title: Checking elements in a value in C
body: <p>How do I read element by elements in C? </p>
  
  <p>In Java I just do:</p>
  
  <pre><code>for(int i = 0; i &lt; str.length; i++){
     if (str.charAt(i) == "X")
     return 1;
  }
  </code></pre>
  
  <p>But I do I do something similar in C?</p>
  
  <p>******Edit: I'm checking an int value for the first occurrence of 1, so the str operation doesn't work. Sorry i forgot to mention that at first.</p>