September 2nd, 2010, 02:33 PM
confused on first parameter of getaddrinfo()
I have a error on this line:
getaddrinfo(argv, DEFAULT_PORT, &hints, &servinfo)
DEFAULT_PORT is a macro I made to the port number.
the next 2 paramters are from:
struct addrinfo hints, *servinfo;
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
There error is with: argv
It is a undeclared identifier and I can't debug with this error.
I followed a tutorial to write all my code and it told me to write argv...
but I thought I was suppposed to write the IP there, Should I write the IP there instead?
I dont really know what argv means.
This if for a Client App.
September 2nd, 2010, 02:41 PM
Re: confused on first parameter of getaddrinfo()
According to MSDN
So if it was set into your argv then it should work, otherwise you'd be probably much easier pass the ip-address directly!?
A pointer to a NULL-terminated ANSI string that contains a ho
st (node) name or a numeric host address string. For the Internet protocol, the numeric host address string is a dotted-decimal IPv4 address or an IPv6 hex address.
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!