Advertisement
paulogp

ping

Aug 14th, 2011
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. // apple xcode
  2. // paulogp
  3.  
  4. /* ping */
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7.  
  8. int main (int argc, const char * argv[])
  9. {
  10.     char the_ip[100] = "localhost";
  11.     char the_command[100];
  12.    
  13.     printf ("ip: ");
  14.     fgets (the_ip, sizeof(the_ip), stdin);
  15.    
  16.     sprintf (the_command, "ping -c 5 %s", the_ip);
  17.     system (the_command);
  18.    
  19.     printf ("done\n");
  20.    
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement