How to divide class in c++ into hpp and cpp files
<p>I don't know how to divide some class into <code>.hpp</code> and <code>.cpp</code> files. Could you tell me how to divide the following example class?</p>

<pre><code>class Foo {
    public:
    int x;
    int getX() {
        return x;
    }
    Foo(int x) : x(x) {}
};
</code></pre>

<p>and how to include this class in <code>main</code> function?</p>