delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/28/18:51:00

From: "Alexei A. Frounze" <alex DOT fru AT mtu-net DOT ru>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: help with a bit stream....
Date: Tue, 28 Mar 2000 23:06:35 +0400
Organization: MTU-Intel ISP
Lines: 21
Message-ID: <38E102BB.263A7CAD@mtu-net.ru>
References: <38E0FCF9 DOT AB82C211 AT gtcom DOT net>
NNTP-Posting-Host: ppp108-219.dialup.mtu-net.ru
Mime-Version: 1.0
X-Trace: gavrilo.mtu.ru 954270572 34400 212.188.108.219 (28 Mar 2000 19:09:32 GMT)
X-Complaints-To: usenet-abuse AT mtu DOT ru
NNTP-Posting-Date: 28 Mar 2000 19:09:32 GMT
X-Mailer: Mozilla 4.61 [en] (Win95; I)
X-Accept-Language: en,ru
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Yes, it is.

For getting Nth bit you must:
1. read (N/8)th byte from the file
2. shift the byte (N%8) times right
3. the lower bit of the result is your Nth bit

Good Luck
Alexei A. Frounze
-- 
Homepage: http://alexfru.chat.ru
Mirror:   http://members.xoom.com/alexfru


Krogg wrote:
> 
> I can open FILEs and read them one byte at a time but i
> really want to read them one BIT at a time...Is there
> a nice way to do this?...


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019