Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pinging from a C/C++ program

I want to write a C or C++ program, that given an IP address, Pings it and then performs further action based on whether the Ping was successful or not. How to do this?

like image 300
Vishal Avatar asked Jul 14 '11 17:07

Vishal


People also ask

What is C in ping command?

-c. Specifies the number of packets. This option is useful when you get an IP trace log. You can capture a minimum of ping packets.

How do I ping from PC to PC?

In Windows, hit Windows+R. In the Run window, type “cmd” into the search box, and then hit Enter. At the prompt, type “ping” along with the URL or IP address you want to ping, and then hit Enter.


1 Answers

Have a blast at The Ping Page, which has a link to full source on the original Unix ping(8).

like image 187
Nikolai Fetissov Avatar answered Oct 02 '22 11:10

Nikolai Fetissov