Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

ping.exe


ghost's Avatar
0 0

What library and command do you use to ping something in C?


ghost's Avatar
0 0

system("ping 127.0.0.1");


ghost's Avatar
0 0

Talking about something like this?

using namespace std;
int main()
{
    string ip;
    string pnglin;
    cout << "IP: ";
    getline(cin,ip);
    pnglin="ping "+ip;
    system(pnglin.c_str());
    getchar();
}
    

Uber0n's Avatar
Member
0 0

^^ system command 4 the lazy ones but I know you didn't mean that… :p


ghost's Avatar
0 0

Uber0n wrote: ^^ system command 4 the lazy ones but I know you didn't mean that… :p Maybe you should post what you would do instead of just critizing. ;)