Why can't I define variables in classes?
<p>Whenever I define a variable and give it a value at the same time inside a class, I get an error. What is the reason for this?</p>

<p>As you can see, this doesn't work...</p>

<pre><code>class myClass {
    private:
        int x = 4; // error
};
</code></pre>

<p>But when I keep the variable undefined it does:</p>

<pre><code>class myClass {
    private:
        int x;
};
</code></pre>
