Understanding Basic Class
<p>I am currently learning about classes and I need a little help understanding.
Here is my sample code:</p>

<pre><code>        #include &lt;iostream&gt;
        using namespace std;

        class Character
        {
            private:
                int health;
                int magic;
                int gold;
            public:
                Character();  
                ~Character();
                int health(int h);
                int magic(int m);
                int gold(int g);
        };

        Character::Character(){}
        Character::~Character(){}
        Character::health(){health = h;}
        Character::magic(){magic = m;}
        Character::gold(){gold = g;}

        void main()
        {
            Character knight;
            knight.health(10);
            knight.magic(10);
            knight.gold(6);

            Character beast;
            beast.health(8);
            beast.magic(0);
            beast.gold(5);

            cout&lt;&lt; knight.health &lt;&lt;endl;
            cout&lt;&lt; knight.magic &lt;&lt;endl;
            cout&lt;&lt; knight.gold&lt;&lt;endl;

            cout&lt;&lt; beast.health &lt;&lt;endl;
            cout&lt;&lt; beast.magic &lt;&lt;endl;
            cout&lt;&lt; beast.gold &lt;&lt;endl;



        system("Pause");
        }
</code></pre>

<p>So my questions are:<br>
Did I set it up correctly? :)<br>
How is private: different from protected: ?<br>
Do I always have to create Character() and ~Character() in my class even though they don't do anything?<br>
Do I have to destruct int health(), int magic() and int gold() like I do for Character?<br>
Looking at some of my fellow classmate's code, I noticed some are not defining the members outside the class.<br> So no:</p>

<pre><code>        Character::Character(){}
        Character::~Character(){}
        Character::health(){health = h;}
        Character::magic(){magic = m;}
        Character::gold(){gold = g;}
</code></pre>

<p>but instead they had it in the Class:</p>

<pre><code>        class Character
        {
            private:
                int health;
                int magic;
                int gold;
            public:
                Character();  
                ~Character();
                int health(int h)
                 { health = h;}
                int magic(int m)
                 { magic = m;}
                int gold(int g)
                 { gold = g;}
        };
</code></pre>

<p>Are they the same? Do they always work the same? Benefits of each? Recommended method? Class and Struct seem very similar...is there a big difference? When would I use Class over Struct? </p>
