title: Issue with using string data type for a class property in C++
body: <p>I'm currently defining a few properties for a class in C++ but I'm running into trouble when using type <code>string</code> as opposed to something like <code>int</code> or <code>double</code>. For example:</p>
  
  <pre><code>private:
      int LOT;
  
  public:
      int getLOT() {
          return LOT;
      }
  
      void setLOT(int value) {
          LOT = value;
      }
  </code></pre>
  
  <p>works fine, but:</p>
  
  <pre><code>private:
      string name;
  
  public:
      string getName() {
          return name;
      }
  
      void setName(string value) {
          name = value;
      }
  </code></pre>
  
  <p>throws these errors:</p>
  
  <p><a href="https://s26.postimg.org/wm5y7922h/error.png" rel="nofollow noreferrer">https://s26.postimg.org/wm5y7922h/error.png</a></p>
  
  <p>The file (a header) looks something like this:</p>
  
  <pre><code>#include "general.h" // a header which includes all my other #includes
  // which, yes, does include &lt;string&gt;
  
  class MyClass
  {
  private:
      string name;
  
  public:
      string getName() {
          return name;
      }
  
      void setName(string value) {
          name = value;
      }
  
      // other properties similar to the above
  }
  </code></pre>
  
  <p>The purpose is to access the variable like this:</p>
  
  <pre><code>cout &lt;&lt; "Enter your name: ";
  cin &gt;&gt; MyClass.setName();
  cout &lt;&lt; "\nHello, " &lt;&lt; MyClass.getName();
  // although this isn't exactly how it'll be used in-program
  </code></pre>
  
  <p>If anyone could provide help with what I'm doing wrong or a better way to go about a string property (as, like I mentioned before, other types work fine) it would be greatly appreciated. Thanks.</p>