English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

program which accepts the IP address in the form(for ex: 153.18.8.105) and converts it into 32bit long interger(ex.2568095849) using strtok library function and unions.
Please give me a c program.am in need.

2007-08-10 17:58:49 · 2 answers · asked by vinu 1 in Computers & Internet Programming & Design

2 answers

This is simple. An IP Address is merely a collection of four 8-bit (byte) quantities -- hence the 32 bits. The only thing you need to know is that these bits are represented in big endian (network byte order) meaning the most significant bit is stored first.

A union you might find useful is

union IPAddress {
unsigned int iIp ; // 32 bit decimal
unsigned char cIp[4] ; // 4 8bit values
} ;

2007-08-10 18:04:09 · answer #1 · answered by mdigitale 7 · 0 0

i would not say switched over extremely. yet certainly one of my superb buddies and the guitarist for our band now did no longer understand lots in any respect approximately punk or pre-punk as quickly as I met him. He became a reasonably great steel head, nonetheless is to be effortless, yet he had a no longer ordinary time appreciating issues that weren't as problematical and quickly and technical as Slayer or Megadeth or Sepaltura, yet over the years because song is a huge component of the two our lives we uncovered one yet another to our very own musical tastes. and because then he's actual discovered that some nicely placed chords or an ordinary yet catchy progression is nicely worth all the skill in the worldwide. besides the undeniable fact that he nonetheless analyze up on each and every thing and is ridiculously stable at guitar of any type, the song he writes himself is only approximately continuously a funky riff or progression and his CD series has a somewhat great punk element to it. And in tunr i've got taken a liking to a pair of his steel, besides the undeniable fact that I nonetheless can't stand something with grotesque gruff vocals, like Sepultura or that form of concern. I even have besides the undeniable fact that taken a wierd liking to the CD Reign In Blood by way of Slayer, do no longer understand why.

2016-11-12 00:23:07 · answer #2 · answered by ? 4 · 0 0

fedest.com, questions and answers