title: C++ Class Methods Declaration Returns Error
body: <p>I have recently started working with C++ classes and had just started when I reached an error. I have a "resource.h" file that contains the class definition of two classes: 'deck' and 'card'. I <code>#include</code>d this file in another file, "card.cpp". In the card.cpp file I described all the methods/functions of the 'card' class. However on compilation I am getting the following the errors (fyi I am using the MinGW compiler for command-line):</p>
  
  <blockquote>
    <p>card.cpp:3:29: error: ISO C++ forbids declaration of 'setCard' with no
    type [-fp ermissive] card.cpp:3:1: error: prototype for 'int
    Card::setCard(char, char)' does not matc h any in class 'Card'
    resource.h:9:8: error: candidate is: void Card::setCard(char, char)</p>
  </blockquote>
  
  <p>The "card.cpp" file:</p>
  
  <pre><code>#include "resource.h"
  
  Card::setCard(char f, char s) {
      face = f;
      suit = s;
  }
  
  Card::Card (char face, char suit) {
      setCard(face, suit);
  }
  
  Card::~Card () {}
  </code></pre>
  
  <p>The "resource.h" file:</p>
  
  <pre><code>typedef unsigned short int UINT;
  class Card;
  class Deck;
  
  class Card {
      public:
          Card(char face, char suit);
          ~Card();        
          void setCard(char face, char suit);
          char getFace() const { return face; }
          char getSuit() const { return suit; }
      private:
          char face;
          char suit;
  };
  
  class Deck {
      public:
          Deck();
          ~Deck();
          Card getCard(UINT x);
  
      private:
          Card myCards[54];
  };
  </code></pre>
  
  <p>What is causing this issue, and why in the world does the compiler think that "Card::setChard()" is an <code>int</code></p>