Program in c ++ that executes A command [closed]

-2

How do I create a Program in c ++ that execute this command when executing it:

ping link

And the ping that sends that page is shown, thanks!

    
asked by Jose011 29.08.2018 в 22:34
source

1 answer

2
#include <iostream>
#include <stdio.h>

using namespace std;

main ()
{

system ("ping www.google.com");
system("pause");
return 0;
}

Since I was scolded (kidding) in this the code goes The library "stdio.h" has the function system, what it does is make some processes in the program (for example system ("cls") to clean the console)

Or in the command console like this case

    
answered by 02.09.2018 в 21:00