I need to create a program that will basically ping a remote host then do something every time that ping fails to get a reply back. I've seen people post code like this before (see below), but this doesn't actually perform in any different fashion if the ping 'fails'.

code:
--------------------------------------------------------------------------------
char blah1[10];
int blah2[10];
char command[20];

blah1 = ping;
blah2 = 127.0.0;

strcat(command, blah1);
strcat(command, blah2);

system(command);
--------------------------------------------------------------------------------