|
-
January 13th, 2011, 11:32 AM
#1
Variable type
Hello. I just started using WinSock and i was using this guide for creating client:
http://www.codeproject.com/KB/IP/winsockintro02.aspx
Everything seems pretty easy in this guide exept one thing... What type of variable should i use for 'addr'?
Code:
if(inet_addr(servername)==INADDR_NONE)
{
hp=gethostbyname(servername);
}
else
{
addr=inet_addr(servername);
hp=gethostbyaddr((char*)&addr,sizeof(addr),AF_INET);
}
if(hp==NULL)
{
closesocket(conn);
return;
}
Thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|