1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to increment IP in C

Discussion in 'C' started by en_7123, Mar 28, 2010.

  1. en_7123

    en_7123 New Member

    Joined:
    Feb 11, 2010
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    0
    Is there any way of incrementing IP addresses like lets say the user enters
    10.xxx.xxx.20 and he wants the next 20 IP so the program should display
    10.xxx.xxx.21
    10.xxx.xxx.22

    and so on until the next 20 IP ??
     
    Last edited: Mar 28, 2010
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    Not directly; you would need to parse the IP address entered (as a string, normally), extract the numbers, then generate the next 20 addresses from that.
     

Share This Page