title: C++ classes - constructor declaration in derived class
body: <p>Socket has a constructor that takes a winsock SOCKET as parameter and stores it in a private variable:</p>
  
  <pre><code>Socket::Socket(SOCKET s) {
      this-&gt;s = s;
  }
  </code></pre>
  
  <p>I'm trying to make a class "GameSocket" that will parse data from my Socket class:</p>
  
  <pre><code>class GameSocket : public Socket {
  
  protected:
  
      void ParseData(unsigned char* data, int size);
  
  };
  </code></pre>
  
  <p>Next to these classes, I have a "Server" class that creates new sockets when needed:</p>
  
  <pre><code>GameSocket* Server::Accept() {
  
      SOCKET a = accept(s, 0, 0);
      if(a==SOCKET_ERROR) {
          return 0;
      }
      else {
          return new GameSocket(a);
      }
  
  }
  </code></pre>
  
  <p>However, this gives me an error on the last "else":</p>
  
  <pre><code>error C2664: 'GameSocket::GameSocket' : cannot convert parameter 1 from 'SOCKET' to 'const GameSocket &amp;'
  </code></pre>
  
  <p>I must be missing something with constructors when dealing with derived classes...</p>
  
  <p>Don't go too hard on me, I'm relatively new to C++ and OOP</p>