Unintentional infinite 'for' loop
<p>I just started programming in C, and while practicing with for loops, I came up with the following piece of code:</p>

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

    int main()
    {
        int x;

        for (x=0;x=10;x=x+1)

           printf("%d\n",x);

        return 0;

    }
</code></pre>

<p>When I run the code, I fall into an infinite loop. In my C manual it says that the condition x =10 is always true, but I can't get my head around it. If I give the variable x a value of 0 at the beginning, should the for loop not even start, or when the value of x reaches 10, shouldn't the loop stop?</p>

<p>Thanks in advance!</p>