In member function, wrong function gets "executed"
<p>I have a header file with the class &quot;Connection&quot; in namespace &quot;ns&quot;.
The &quot;Connection&quot; class has a function called &quot;connect&quot;, which internally uses
the Winsock &quot;connect&quot; function. When I want to define the function in the .cpp file, I get error because of wrong parameters. Like it doesn't want to &quot;use&quot; the connect function from the winsock API, just the member function.</p>
<p>Looks like this in the .cpp file: (not final)</p>
<pre><code>bool ns::Connection::connect(char IP[],unsigned short Port)
{
    SOCKADDR_IN server_addr;
    memset(&amp;server_addr,0,sizeof(SOCKADDR_IN));

    server_addr.sin_family = AF_INET;
    server_addr.sin_port = Port;
    server_addr.sin_addr.s_addr = inet_addr((const char*)IP);

    connect(client,&amp;server_addr,0); // here comes the error
}
</code></pre>