i need to know the command to ping a server in c++
anyone know it?
Printable View
i need to know the command to ping a server in c++
anyone know it?
There is no C++ "command" to call ping. It's a library call, if anything.
You're best bet might be to use the system() function (or whatever is the equivalent in your dialect of C++) to just call the ping command. E.g. system("ping <ip-addr>") and check the return code.
Or you could try the tcp.h library on your system. Ping is ICMP protocol, not tcp or udp, so you actually might have to dig around some. Or download the source for a working ping command and see what they use.
thank you sir i will look into thatQuote:
Originally posted by gameboy1234
There is no C++ "command" to call ping. It's a library call, if anything.
You're best bet might be to use the system() function (or whatever is the equivalent in your dialect of C++) to just call the ping command. E.g. system("ping <ip-addr>") and check the return code.
Or you could try the tcp.h library on your system. Ping is ICMP protocol, not tcp or udp, so you actually might have to dig around some. Or download the source for a working ping command and see what they use.