Jump to content

Hey , cold some one help me. I need to do this work asap. and i cant figure it out cold someone of you help me wold be much appriciated.

People how know pascal i can do this program on c++ but i need to make it a pascal program . still dont ask me  why 

So i need to display any ip addres and display subnet mask for example 255.0.0.0 it needts to go to binary like this 111111.0.0.0 and the same for ip for example 192.145.87.10 and it goes 111111.11111.1111.1111 thats like for example its not correct but cold someone help me plz.

Link to comment
https://linustechtips.com/topic/588896-help-me-plz/
Share on other sites

Link to post
Share on other sites

void ConvertToBinary(int n)
{
    if (n / 2 != 0) {
        ConvertToBinary(n / 2);
    }
    printf("%d", n % 2);
}

Now all you need to do is split the ip at the dots and drop each one into that Function.

 

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
https://linustechtips.com/topic/588896-help-me-plz/#findComment-7669707
Share on other sites

Link to post
Share on other sites

2 hours ago, eupuriation said:

@vorticalbox its c++ not free pascal -.- but thanks for thank . didnt help at all ;S

sorry saw c++ and assumed :P google shows pascal has this http://www.freepascal.org/docs-html/rtl/strutils/inttobin.html the logic is the same.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
https://linustechtips.com/topic/588896-help-me-plz/#findComment-7682764
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×