stumped

This is a discussion on stumped within the C++ Programming forums, part of the General Programming Boards category; What you can you is call the 'ping' from inside you program using the system() function. In your call you ...

  1. #1
    Unregistered
    Guest

    stumped

    What you can you is call the 'ping' from inside you program using the system() function. In your call you can redirect the output of ping to a file. After ping did its job, you can read the contents of the file and sort the data based on your needs.

    ^ from some other thread....

    i have tried to a_file<<system(Doscommand)<<endl; but all that will return is 0... so help me i have been trying this forever grrrr...

  2. #2
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    Try this:
    system("Doscommand >> filename.txt")

    For example:
    system("dir >> filename.txt")

    will send the output of the dir command to filename.txt.

    A single > will also work:
    system("dir > filename.txt")

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. syntax stumped. simple.
    By CodeMonkey in forum C++ Programming
    Replies: 2
    Last Post: 03-04-2009, 06:36 PM
  2. Can someone help me im totally stumped
    By Joe123 in forum C++ Programming
    Replies: 2
    Last Post: 10-18-2005, 01:17 PM
  3. totally stumped
    By sand_man in forum C Programming
    Replies: 6
    Last Post: 08-22-2004, 08:12 PM
  4. Writing a "Protocol" - Stumped.
    By mrpickle in forum Game Programming
    Replies: 8
    Last Post: 01-21-2004, 07:37 PM
  5. help with stl search/find, or something else- stumped!
    By Terranc in forum C++ Programming
    Replies: 3
    Last Post: 12-21-2002, 04:11 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21