char *hostname = "www.microsoft.com"; msec = ping(hostname); if (msec == -1) printf("Ping <I>%s<I> failed.", hostname); else printf("Ping <I>%s<I> responded in %d msec.", hostname, msec);