LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-15-2007, 03:05 AM   #1
adnap
LQ Newbie
 
Registered: Apr 2007
Posts: 5

Rep: Reputation: 0
byte order conversion from network to host...


hi friends,

does anyone know how to convert a uint8_t variable from network to host byte ordering....
ntohs is for uint16_t and ntohl is for uint32_t....??

thanking u in advance
 
Old 04-15-2007, 04:36 AM   #2
dmail
Member
 
Registered: Oct 2005
Posts: 970

Rep: Reputation: Disabled
Big and Small Endian is the arrangement of bytes in memory so one endian may store a 32 bit int as:
byte1 byte2 byte3 byte4
whilst the other endian would store it as
byte4 byte3 byte2 byte1.
The arrangement of a single byte is endian independent as it is only a single byte.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[Perl] basic byte conversion script noir911 Programming 1 11-21-2006 01:01 AM
C : byte order of served http binary file. slzckboy Programming 5 06-22-2006 02:36 PM
Network device startup order kiley_rodgers Slackware 2 05-08-2006 03:00 PM
Howto Backup Your Downloaded Rpm Files In Order To Create A Network Smb repository xbaez SUSE / openSUSE 1 01-14-2006 10:47 AM
backup byte-for-byte axion0917 Linux - Software 2 12-11-2003 05:01 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration