From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ddd2479bb7fae4af X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!nntp.giganews.com.MISMATCH!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 08 Feb 2005 12:51:25 -0600 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Bit manipulation References: X-Newsreader: Tom's custom newsreader Message-ID: Date: Tue, 08 Feb 2005 12:51:25 -0600 NNTP-Posting-Host: 67.161.24.234 X-Trace: sv3-9YgmBANmEKEyse9qLq67Gq1jwzPxNdhIK6CUPLyFaP8rfNV7udvC29l0Aynym6h87a/yrvqk5bC1Z9/!loxAYn+kzrOTXDbJUSTLWsqnvTRLSJnCoZHzvvtds0X/H//4l6m9n0jTPaFjlQ== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.23 Xref: g2news1.google.com comp.lang.ada:8194 Date: 2005-02-08T12:51:25-06:00 List-Id: > > second, i need to send the 32 bit word over a Tcp connection to a C > > program, but > > socket work with usigned 8 bit word, so i need to split the 32 bit in > > 4 8bit word, > > and when i read from the socket take 4 8bit word and combine in a 32 > > word. > > You should look beware of "network byte order" when you do this mapping. He did not say he was communicating with some other program that expected a certain byte order, so he's free to choose any order he wants. Of course the C program might be on another machine with another byte order, or another floating point representation, etc, so he might need to convert a 32 bit "word" on machine A to the equivalent on machine B.