i need a C program which will do the above task...
Oh gee -- that sure took a loooong time to find. Learn to use google.
i posted this thread after searching on net...
now if u have any matter directly related to the topic....post it..
If the hostname resolves can't you just ping it and collect the ip information?
IPv4: man gethostbyname http://www.freebsd.org/cgi/man.cgi?query=gethostbyname&sektion=3&apropos=0&manpath=FreeBSD+7.0-stable
IPv6 and other address families: gethostbyname2 getaddrinfo http://www.freebsd.org/cgi/man.cgi?query=getaddrinfo&sektion=3&apropos=0&manpath=FreeBSD+7.0-stable
// IPv4 address lookup
const char* const host = "www.toolbar.google.com" ;
const hostent* host_info = 0 ;
for( int attempt=0 ; (host_info==0) && (attempt<3) ; ++attempt )
host_info = gethostbyname(host) ;
std::cout << "host: " << host_info->h_name << '\n' ;
for( int i=0 ; host_info->h_aliases[i] ; ++i )
std::cout << " aka: " << host_info->h_aliases[i] << '\n' ;
for( int i=0 ; host_info->h_addr_list[i] ; ++i )
const in_addr* address = (in_addr*)host_info->h_addr_list[i] ;
std::cout << " address: " << inet_ntoa( *address ) << '\n' ;
else herror( "error" ) ;
I have an automated API with a secure frontend/backend structure where backend object attributes are hidden with frontend proxy classes.
basically, when accessing an object from the frontend, you get ...
I'm not a c++ dev but a VB.NET developer. I will first explain my scenario so that the question would be clear. Suppose I had a form which ...
I am working on program that will connect to MySQL database, colect data from table and show them in grid. Where user can edit cell, and then on ...