Jump to content

[c++] Subnet calculator source

- - - - -

  • Please log in to reply
No replies to this topic

#1
It-Cheff

It-Cheff

    Newbie

  • Members
  • Pip
  • 1 posts
Hi all

Im a newbie (to put it nicely) and I have been learning c++ on-and-off for some months now. One of the very first programs I started to make was a subnet calculator. I started this project back when i first learned about if/else and it did'nt take long for me to abandon it. After that I've been looking at it from time to time and it does have some working functions but it also has some flaws that im investigating.

Now before you all start asking for my (AWSOME) code, I'm not really looking for help on my own project (yet). What I would like, was to see how someone (who may actually have known what they are doing all along) would go by this. So if you have made a subnet calculator or even part of one could you show me how you have done it?

So far my program can:
Convert ip / sm to binary.
Tell you network class (a,b,c NOT d,e).
Calculate number of borrowed bits.
Tell you max number of subnets.
Tell you max number of hosts on each subnet.
Tell you network address of ip entered.

My program has the following (known) shortcommings:
EVERYTHING is in main()!
It can't take in IP / SM in 192.168.0.1 format, insted user has to use enter insted of [.].
500 lines of code; I know that can be improved!
A flawed claculation for calculating the BC address.

Thanks in advance

IT-Cheff




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users