Secam se da je i predator svojevremeno :o), imao isti problem, ali je na kraju napisao, i ja sam imao taj kod ali sada ne mogu nikako da nadjem, nego da predjem na stvar:
Code:
#include <stdio.h>
#include <unistd.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
int main()
{
char names[100];
struct hostent *h;
gethostname(names, strlen(names));
if ((h=gethostbyname(names))== NULL) { // get the host info
herror("gethostbyname");
exit(1);
}
if ((h=gethostbyname(names))== NULL) { // get the host info
herror("gethostbyname");
exit(1);
}
printf("gethostname:Host name : %s\n",names); // moje debugiranje...
printf("gethostbyname:Host name : %s\n", h->h_name);
printf("IP Address : %s\n", inet_ntoa(*((struct in_addr *)h->h_addr)));
return 0;
}
#include <stdio.h>
#include <unistd.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
int main()
{
char names[100];
struct hostent *h;
gethostname(names, strlen(names));
if ((h=gethostbyname(names))== NULL) { // get the host info
herror("gethostbyname");
exit(1);
}
if ((h=gethostbyname(names))== NULL) { // get the host info
herror("gethostbyname");
exit(1);
}
printf("gethostname:Host name : %s\n",names); // moje debugiranje...
printf("gethostbyname:Host name : %s\n", h->h_name);
printf("IP Address : %s\n", inet_ntoa(*((struct in_addr *)h->h_addr)));
return 0;
}
Moze neko i da bachi predatorov kod ako ima!
Would you translate me on the other page in face = Da li biste me preveli na drugu stranu ulice