Thread: stumped

  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, 12:17 PM
  3. totally stumped
    By sand_man in forum C Programming
    Replies: 6
    Last Post: 08-22-2004, 07: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