c++ ping program

i just finished a c++ course in my school and i want to write a program to use at home, also for my dad to use. my dsl has been going out recently and i check the connection by pinging yahoo.com usually. but the ping program times out after a little while of no responces. so what i want to do is this, write a c++ program where it will ask you what host you want to ping, and it will open the ping program. now if there is a responce, it will output the responce and then the program will end. if there is no responce in a given amount of time, like 5 seconds, it will kill the ping program and restart it and keep trying until a responce is recieved. i want to do this in c++ because i will want to compile this for windows so my dad can use it, the only access to any compiler is at school, and only c++. so my question is this, in c++ how can i call an outside program? i will specify in the program where to look for the program, (/bin/ping) and when i want to compile it for windows i will just change the location. ive done this in a shell script with bash, and thats what i use now for when the dsl goes out, but this is a personal project of mine to get this running and mainly so my dad can use it. this is not a homework question.

You could always do this in Perl - in fact, there are answers in this forum on how to do it as I've helped to write a couple!

:wink:

thank you. i will search your threads and post back when ive found the solution.

i have got similiar problem.. i have created program, which has database of ip and mac address in wifi. wifi ap is controling ip and macs, so I need to change both. i have program that first prints all ips and macs to the screen, and than asks user for ip he want. after you enter ip, program configures all, and i am able to connect.

this is my problem: now i must first use nmap to check if my victim is online. if he is, i am not able to change my addresses to victim's. if his offline i can do it. so i want to change my program. it checks if victim is online, and prints it to screen. or just print only offline victims..

so i need PING for c++

zero0x, read the rules.

You won't get any help disrupting the connectivity of your victims on this site.