Unix Programming - Re: how to get the numbers-and-dots notation back from network byte

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > August 2004 > Re: how to get the numbers-and-dots notation back from network byte





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: how to get the numbers-and-dots notation back from network byte
Måns Rullgård

2004-08-27, 6:21 pm

wim.deprez+google@student.luc.ac.be (Wim Deprez) writes:

> Hello group,
>
> my input is a network byte order long that represents an ip address,
> and I want to the char * numbers-and-dots notation back, for example
> to write it out to the user or something. How do I do that?
>
> a stupid example:
>
> int main (int argc, char* argv[])
> {
> unsigned long ma = inet_addr("185.21.0.9");
>
> printf("%s",XXX(ma));
> return 0;
> }
>
> where XXX(ma) becomes "185.21.0.9" again.


inet_ntoa()

--
Måns Rullgård
mru@mru.ath.cx
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com