error: expected unqualified-id
<p>So, i have searched around for answers, and multiple people have got the same error response but i cannot see how their errors could fix my code.</p>

<p>I started trying out c++ yesterday, but i am experienced with mostly Python but also C#</p>

<p>I am making a simple contact book, just for learning.
I am not done with the class or any other implementation, just need this fixed first.</p>

<p>the exact error is</p>

<pre><code>kontaktbok.cpp:9: error: expected unqualified-id before 'public'
</code></pre>

<p>And the code is here</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;sstream&gt;

using namespace std;

bool running = true;

public class Contact
{
    private:
        string firstname   = "";
        string lastname    = "";
        string phonenumber = "";

    public:
        Contact()
        {
            this.firstname = "Alfred";
        }
};

int main()
{
        cout &lt;&lt; "Welcome to the Contact book!" &lt;&lt; endl &lt;&lt;
                "Made by X";
    while (running)
    {
        cout &lt;&lt; "1. Add contact"    &lt;&lt; endl
             &lt;&lt; "2. List contacts"  &lt;&lt; endl
             &lt;&lt; "3. Quit"           &lt;&lt; endl;
        cout &lt;&lt; "Choice: ";
        string mystr;
        getline(cin, mystr);
        int choice;
        stringstream(mystr) &gt;&gt; choice;
        switch (choice)
        {
            case 1: cout &lt;&lt; "asd";
            case 2: cout &lt;&lt; "asd2";
            case 3: running = false;
            default : cout &lt;&lt; "Invalid integer";
        }
    }
    return 0;
}
</code></pre>

<p>Thanks in advance!</p>
