Link to home
Start Free TrialLog in
Avatar of mtcmedia
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,serverhost->h_addr,serverhost->h_length);

Data is defined as: char *data[20];
Avatar of Axter
Axter
Flag of United States of America image

Hi mtcmedia,

What type is data?
What type is saddr?
What type is h_addr?
>>Data is defined as: char *data[20];

How are you allocating space for the variable, and how are you populating it?
ASKER CERTIFIED SOLUTION
Avatar of Axter
Axter
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial