title: Visual Studio 2015 "non-standard syntax; use '&' to create pointer for member"
body: <p>I'm creating a quick game and I used a different class file for inputting player names. I keep getting the specified error :</p>
  
  <blockquote>
    <p>use '&amp;' to create pointer for member</p>
  </blockquote>
  
  <p>when I am trying to call the function from main. </p>
  
  <p>The function <code>getPlayerOne</code> and <code>getPlayerTwo</code> are public functions. I think it's because I'm changing the <code>player1</code> value so I need a pointer but when I try to add a pointer it gives me the same error. </p>
  
  <p>How do I edit values of strings using pointers?</p>
  
  <p>main:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  //Included Header Files
  #include "Player.h"
  
  using namespace std;
  
  int main() {
  
      Player players;
      cout &lt;&lt; players.getPlayerOne &lt;&lt; endl;
      cout &lt;&lt; players.getPlayerTwo &lt;&lt; endl;
  
  }
  </code></pre>
  
  <p>Player.h:</p>
  
  <pre><code>#pragma once
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  class Player
  {
  public:
  
      //Initialize player1
      void getPlayerOne(string &amp;playerOne);
      void getPlayerTwo(string &amp;playerTwo);
  
  
      Player();
  private:
  
      //Players
      string player1;
      string player2;
  };
  </code></pre>
  
  <p>Player.cpp</p>
  
  <pre><code>#include "Player.h"
  
  Player::Player()
  {
  }
  
  void Player::getPlayerOne(string &amp;playerOne) {
      cout &lt;&lt; "Enter player 1 name: \n";
      cin &gt;&gt; playerOne;
      cout &lt;&lt; playerOne &lt;&lt; " is a great name!\n";
      player1 = playerOne;
  }
  
  void Player::getPlayerTwo(string &amp;playerTwo) {
      cout &lt;&lt; "Enter player 2 name: \n";
      cin &gt;&gt; playerTwo;
      cout &lt;&lt; playerTwo &lt;&lt; " is a great name!\n";
  
      player2 = playerTwo;
  }
  </code></pre>
  
  <p>I could probably just put the <code>Player</code> code in main because it's so small, but I think it is better to have separate classes when (eventually) I can program files with more characters.</p>