title: IntelliSense: the object has type qualifiers that are not compatible with the member function
body: <p>I have a class called Person:</p>
  
  <pre><code>class Person {
      string name;
      long score;
  public:
      Person(string name="", long score=0);
      void setName(string name);
      void setScore(long score);
      string getName();
      long getScore();
  };
  </code></pre>
  
  <p>In another class, I have this method:</p>
  
  <pre><code>void print() const {
       for (int i=0; i&lt; nPlayers; i++)
          cout &lt;&lt; "#" &lt;&lt; i &lt;&lt; ": " &lt;&lt; people[i].getScore()//people is an array of person objects
      &lt;&lt; " " &lt;&lt; people[i].getName() &lt;&lt; endl;
  }
  </code></pre>
  
  <p>This is the declaration of people:</p>
  
  <pre><code>    static const int size=8; 
      Person people[size]; 
  </code></pre>
  
  <p>When I try to compile it I get this error:</p>
  
  <pre><code>IntelliSense: the object has type qualifiers that are not compatible with the member function
  </code></pre>
  
  <p>with red lines under the the 2 <strong>people[i]</strong> in the print method</p>
  
  <p>What am I doing wrong?</p>