title: C2084 - function already has a body
body: <p>I'm running into an error <strong><em>"C2084 - function 'void Pet::display(void)' already has a body"</em></strong>. Error occurs on Dog.cpp file. Slightly confused about the issue. Any help would be appreciated. </p>
  
  <hr>
  
  <p><strong>Pet.h</strong></p>
  
  <pre><code>#ifndef _PET_H_
  #define _PET_H_
  
  #include &lt;string&gt;
  using namespace std;
  
  enum Type { dog = 0, cat };
  
  class Pet {
  private:
      string name, breed; // private local variables
      Type type;
  
  public:
      Pet(string pet_name, string pet_breed, Type pet_type); // constructor
  
      // accessor methods
      string getName();
      string getBreed();
      Type getType();
  
      virtual void display() {};
  };
  
  #endif // _PET_H_
  </code></pre>
  
  <p><strong>Dog.h</strong></p>
  
  <pre><code>#ifndef _DOG_H_
  #define _DOG_H_
  
  #include "Pet.h"
  #include &lt;string&gt;
  
  using namespace std;
  
  class Dog : public Pet {
  public:
      Dog(string pet_name, string pet_breed, Type pet_type) : Pet(pet_name, pet_breed, pet_type) {
      } // constructor
  
      virtual void display() = 0;
  
  };
  
  #endif 
  </code></pre>
  
  <p><strong>Dog.cpp</strong></p>
  
  <pre><code>#include "Dog.h"
  #include "Pet.h"
  #include &lt;iostream&gt;
  
  void Pet::display() {
      cout &lt;&lt; "Name: " &lt;&lt; name &lt;&lt; endl;
      cout &lt;&lt; "Breed: " &lt;&lt; breed &lt;&lt; endl;
      cout &lt;&lt; "Type: Dog" &lt;&lt; endl;
  }
  </code></pre>