need of c++ command

Sharky Forums


Results 1 to 3 of 3

Thread: need of c++ command

  1. #1
    Engineer credit to *****! flutie98's Avatar
    Join Date
    Mar 2002
    Location
    CNSE UAlbany
    Posts
    4,111

    need of c++ command

    i need to know the command to ping a server in c++
    anyone know it?
    |Core i5 2500K @ 4.6GHz|MSI Z77-GD65|8.0GB G.skill DDR3 1600|XFX AMD 6870|
    |Samsung 830 SSD|HP LP2465 24" LCD|Antec P280|Seasonic X750 PSU|H2O Cooling|Windows 7 x64|

    |Core i3 2100|ASRock H61-GM|8.0GB DDR3|AMD Radeon 6450|Kingston V100+ SSD|
    |Antec Fusion V2|Epson 8350 1080P 3LCD on 100" EliteScreen|

    |ThinkPad T420|Core i5 2520M|8.0GB DDR3|OCZ Vertex 4|

    Audio: Radeon 6450 (HDMI)->Onkyo TX-NR509 ->Polk M60/M30/CSII + Velodyne VX10

  2. #2
    Catfish gameboy1234's Avatar
    Join Date
    Aug 2002
    Posts
    238
    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.

  3. #3
    Engineer credit to *****! flutie98's Avatar
    Join Date
    Mar 2002
    Location
    CNSE UAlbany
    Posts
    4,111
    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.
    thank you sir i will look into that
    |Core i5 2500K @ 4.6GHz|MSI Z77-GD65|8.0GB G.skill DDR3 1600|XFX AMD 6870|
    |Samsung 830 SSD|HP LP2465 24" LCD|Antec P280|Seasonic X750 PSU|H2O Cooling|Windows 7 x64|

    |Core i3 2100|ASRock H61-GM|8.0GB DDR3|AMD Radeon 6450|Kingston V100+ SSD|
    |Antec Fusion V2|Epson 8350 1080P 3LCD on 100" EliteScreen|

    |ThinkPad T420|Core i5 2520M|8.0GB DDR3|OCZ Vertex 4|

    Audio: Radeon 6450 (HDMI)->Onkyo TX-NR509 ->Polk M60/M30/CSII + Velodyne VX10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •