-
First of all, your responses are wrong. What you would send back to the server is:
Since the IRC message will be sent to you in the same format, all you have to do is replace the PING with PONG. You code can be as simple as:
Code:
if(!strncmp(szIrcMsg,"PING",4))
{
memcpy(szIrcMsg,"PONG",4);
// Send szIrcMsg back to the server now
}
-
How should I declare the identifier szIrcMsg? I got this errors while compiling:
Code:
79 C:\Files\dev\Projects\IRCD.cpp `szIrcMsg' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)
(PS: sorry for all the questions im sorta new to c++) Thanks.
-
szIrcMsg is the buffer that you receive the data from the server into.
You might want to spend some time learning the ins and outs of the language before you jump into something like an IRC bot.