Jump to content

problem with "sin_addr.s_addr"


vha

Recommended Posts

hi, I have this code for windows:

   struct sockaddr_in sin;
struct hostent* host;

host = gethostbyname("appmsg.gadu-gadu.pl");

sin.sin_family = AF_INET;
sin.sin_addr.s_addr = *((unsigned long*) host->h_addr);
sin.sin_port = htons(80);

 

and i want to use it on my DS, but when i compile someting like this:

 

#include <PA9.h>	   
#include "main.h"
.
.
.
struct sockaddr_in client;
struct hostent* host;
host = gethostbyname("appmsg.gadu-gadu.pl");
client.sin_family = AF_INET;
client.sin_addr.s_addr=  *((unsigned long*) host->h_addr);
client.sin_port = htons(80);

I get: " error: 'struct hostent' has no member named 'h_addr'

 

How to fix this?

(sorry for my poor English)

Edited by vha
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...