#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    kuala lumpur
    Posts
    1
    Rep Power
    0

    Question i have a problem in c++ programming,help!!!!!


    hello!!
    please help me to solve this problem!!
    please reply before 31.08.2003!!

    Numeric address for computers on the Internet consists of four parts separated by periods (IPv4) in the form of zzz.yyy.xxx.www, where zzz, yyy, xxx and www are positive integers ranging from 0 to 255. Alternatively, computers are locally identified by a string of characters (host-name). Let’s assume we will be dealing with only a Class C* network. Create a program to process a list of internet addresses with their respective host-names – it must be able to search for a given host-name or an internet address. The program must also be able to identify the network class and list all computers residing in a given network.

    Program Requirements:

    • Create a data structure for a single computer (pair of internet address and hostname).
    • Ability to detect the network address from an IP address, thus enabling it to list computers residing on that network.
    • Consider all IP not within the class C network as invalid.

    *Note: There are 5 network classes (A to E), categorized by the number of bits allocated for network address and host address. Obviously, you have a total of 32 bits to represent the IP address in IPv4. For a class C network, the first 3 bits are reserved for network class identifier. The next 21 bits are used for network address and the final byte is for the host address. Therefore, the range of IP address for a class C network is 192.x.x.x to 223.x.x.x (x means it can be any integer from 0 to 255). You also need to know that a network mask to filter out the host address for this network class is 255.255.255.0 (using a logical-AND operation).

    **Special notation:

    Network addess = 0 Local network
    Host address = 0 Broadcast
    Host address = 1 Usually for routers (interface address)

    :confused:
  2. #2
  3. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    Ok, first off this smells like homework. If it is, then you just might be barking up the wrong forum. If not, then don't worry about it.

    Second, I would recommend that you read the "How to Post a Question" sticky thread at the top of this forum for more info on subject titles. Yours is lacking.

    Third, you have described a requirement but not the problem you are having, errors, code, etc...

    Last, but not least, welcome to the Dev Shed community.
  4. #3
  5. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,175
    Rep Power
    2222
    I cover the subject of IP addressing and address classes here: http://members.aol.com/dsc30574/sockets/ip_addr.html
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    Flint, MI
    Posts
    328
    Rep Power
    12
    Gotta love it when we get near the end of the semester. Lots of people panicing to get their final projects done.
    Clay Dowling
    Lazarus Notes
    Articles and commentary on web development
    http://www.lazarusid.com/notes/
  8. #5
  9. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,175
    Rep Power
    2222
    Yeah, the limbic system kicks into high gear and the neocortex shuts down just when you need it the most.

IMN logo majestic logo threadwatch logo seochat tools logo