mtcmedia
asked on
Using getbyhostname()
Hello Experts,
My errors are:
194: warning: assignment makes pointer from integer without a cast
198: error: dereferencing pointer to incomplete type
On lines:
194: if((serverhost = gethostbyname(data[1])) < 0) {
198: memcpy(&ip->saddr,serverho st->h_addr ,serverhos t->h_lengt h);
Data is defined as: char *data[20];
My errors are:
194: warning: assignment makes pointer from integer without a cast
198: error: dereferencing pointer to incomplete type
On lines:
194: if((serverhost = gethostbyname(data[1])) < 0) {
198: memcpy(&ip->saddr,serverho
Data is defined as: char *data[20];
>>Data is defined as: char *data[20];
How are you allocating space for the variable, and how are you populating it?
How are you allocating space for the variable, and how are you populating it?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What type is data?
What type is saddr?
What type is h_addr?