title: C++ Function calling fails
body: <p>I get the following error when declaring a function:</p>
  
  <pre><code>Users/masterprogrammer/PycharmProjects/WolvesBatsRocks/c++/c++example.cpp:23:5: error: no matching function for call to 'printstats'
      printstats(&amp;x, y);
      ^~~~~~~~~~
  /Users/masterprogrammer/PycharmProjects/WolvesBatsRocks/c++/c++example.cpp:10:6: note: candidate function not viable: no known conversion from 'const std::string *' (aka 'const basic_string&lt;char, char_traits&lt;char&gt;, allocator&lt;char&gt; &gt; *') to 'const std::string' (aka 'const basic_string&lt;char, char_traits&lt;char&gt;, allocator&lt;char&gt; &gt;') for 1st argument; remove &amp;
  void printstats(const std::string&amp; x, int statnum);
       ^
  /Users/masterprogrammer/PycharmProjects/WolvesBatsRocks/c++/c++example.cpp:12:6: note: candidate function not viable: no known conversion from 'const std::string *' (aka 'const basic_string&lt;char, char_traits&lt;char&gt;, allocator&lt;char&gt; &gt; *') to 'char *' for 1st argument
  void printstats(char * x, int stat_num)
       ^
  1 error generated.
  [Finished in 0.9s with exit code 1]
  [shell_cmd: g++ "/Users/masterprogrammer/PycharmProjects/WolvesBatsRocks/c++/c++example.cpp" -o "/Users/masterprogrammer/PycharmProjects/WolvesBatsRocks/c++/c++example" &amp;&amp; "/Users/masterprogrammer/PycharmProjects/WolvesBatsRocks/c++/c++example"]
  [dir: /Users/masterprogrammer/PycharmProjects/WolvesBatsRocks/c++]
  [path: /anaconda3/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin]
  </code></pre>
  
  <p>The function takes two inputs and I am calling it from <code>main</code>.
  I am expecting an output which has the following formatting <code>Strength: 7</code>.
  Here is the code:</p>
  
  <pre><code>// C program to illustrate
  // call by value
  #include &lt;stdio.h&gt;
  #include &lt;iostream&gt; 
  #include &lt;ctime&gt;    // For time()
  #include &lt;cstdlib&gt;  // For srand() and rand()
  #include &lt;string&gt;
  #include &lt;cstring&gt;
  
  void printstats(const std::string&amp; x, int statnum);
  
  void printstats(char * x, int stat_num)
  {
      printf("%s: %d", x, stat_num);
  }
  
  int main(void)
  {
      const std::string&amp;x = "Strength";
      int y = 7;
  
      // Passing parameters
      printstats(&amp;x, y);
  
      return 0;
  }
  </code></pre>