Trouble using strings
<p>I'm a beginner. I don't know why I can't use strings. It says <code>string does not have a type</code>.</p>

<p><strong>main.cpp</strong></p>

<pre><code>    #include &lt;iostream&gt;
    #include &lt;string&gt;
    #include "Pancake.h"

using namespace std;

int main() {

    Pancake good;

    good.setName("David");

    cout &lt;&lt; good.name &lt;&lt; endl;

}
</code></pre>

<p><strong>Pancake.h</strong></p>

<pre><code>#ifndef PANCAKE_H
#define PANCAKE_H
#include &lt;string&gt;

class Pancake {
    public:
        void setName( string x );
        string name;
    protected:
    private:
};

#endif // PANCAKE_H
</code></pre>

<p><strong>Pancake.cpp</strong></p>

<pre><code>#include &lt;iostream&gt;
#include "Pancake.h"
#include &lt;string&gt;

using namespace std;

void Pancake::setName( string x ) {
    name = x;
}
</code></pre>

<p>This only happens when I use strings. When I use a integer and replace <code>string x</code> with <code>int x</code> in all instances of <code>string x</code> it then works. But why?</p>
