title: error: no member function declared in class
body: <p>I keep getting the following errors from my code:</p>
  
  <p>(line 58) error: no 'std::string Person::Modify_Person(Person)' member function declared in class 'Person' In function 'int main()':</p>
  
  <p>(line 113) error: 'Modify_Person' was not declared in this scope</p>
  
  <p>Here is the code: </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  void PassByByValue(int num2){
  
    cout &lt;&lt; "You are in PassByValue()" &lt;&lt; endl;
  
    num2++;
  
  }
  class Person{
      int age;
      string name;
      int height;
      int weight;
  public:
  
      Person(){
  
      }
  
      Person(string name){
          this-&gt;name=name;
      }
  
      string getName(){
      return this-&gt;name;
      }
  
      void setAge(int age){
      this-&gt;age=age;
      }
  
  
      void setName(string name){
      this-&gt;name=name;
      }
  
      void setHeight(int height){
      this-&gt;height=height;
      }
  
      void setWeight(int weight){
      this-&gt;weight=weight;
      }
  
  
      ~Person(){
  
      }
  
  };
  
  
  
  string Person::Modify_Person(Person example){
  
      example.getName()="Jessica";
  
      return example.getName();
  }
  
  void PassByRef(int&amp; num3){
  
  cout &lt;&lt; "You are in PassByRef()" &lt;&lt; endl;
  
  num3=50;
  
  cout &lt;&lt; "inside PassByRef() pNum is: " &lt;&lt;num3&lt;&lt;endl;
  
  }
  
  int main()
  {
     int num1;
     int* pNum;
  
      num1=3;
      *pNum=5;
  
      PassByByValue(num1);
  
      cout &lt;&lt; "num1= " &lt;&lt;num1 &lt;&lt;endl;
  
      PassByRef(*pNum);
  
      cout &lt;&lt; "outside PassByRef() in main() pNum is: " &lt;&lt;pNum&lt;&lt;endl;
  
      PassByByValue(*pNum);
  
      double* DblePtr;
  
      DblePtr= new double;
  
      *DblePtr=12.0;
  
      cout&lt;&lt; "DblePtr: "&lt;&lt; &amp;DblePtr;
  
      delete[] DblePtr;
  
      cout&lt;&lt; "DblePtr: "&lt;&lt; &amp;DblePtr;
  
      Person human;
      human.setName("Kate");
      human.setAge(27);
      human.setHeight(100);
      human.setWeight(100);
  
      Modify_Person(human);
  
      cout &lt;&lt; "Modify_Person returns: " &lt;&lt; Modify_Person(human) &lt;&lt;endl;
  
      cout &lt;&lt; "name should be Jessica: " &lt;&lt; human.getName() &lt;&lt; endl;
  
      return 0;
  }
  </code></pre>