Find the answer to your Linux question:
Results 1 to 4 of 4
can anybody help me how to ping multiple IP address using C........
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    2

    ping multiple IP address using C

    can anybody help me how to ping multiple IP address using C.....

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    I don't quite understand the question. Just take your code for pinging one address and throw it in a for(;;) loop.

    Or is your question how to ping, period?

    I'm confused.

  3. #3
    Just Joined!
    Join Date
    Sep 2007
    Posts
    2
    I've already do the command :

    #include<stdio.h>
    int main()
    {
    system("ping -c4 192.168.7.x");
    return 0;
    }

    but i don't know how to make the loop for variable x value...

    can you help me by give the command/source code?
    tq...

  4. #4
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    I won't do the work for you, but I'll help you learn a little more about C, by suggesting that you do this at the command line:
    Code:
    man sprintf
    Hope this helps.

Posting Permissions

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