Compare char array element to string literal
<p>I've been trying get part of a string from a char array, and for the life of me, I cannot get any of the examples I've found on StackOverflow to work:
<a href="https://stackoverflow.com/questions/25528380/compare-string-literal-vs-char-array">Compare string literal vs char array</a>
I've looked all over the internet for a solution, I've tried mixing pointers, strcmp, strncmp, everything I can think of.</p>

<p>I cannot see how to get this to work:</p>

<pre><code>#include &lt;stdio.h&gt;

int main(void) {
 const char S[] = "0.9";
 if (S[1] == ".") {
    puts("got it");
 }
 return 0;
}
</code></pre>

<p>I realize posting this may ruin my reputation... but I could not find the solution.... similar articles didn't work.</p>

<p>thanks in advance for your help :/</p>

<p><em>EDIT</em>: I was not aware of the correct search terms to use; that's why I didn't find the specified original.</p>