🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #5193

Re: VRAAGJE C/C++

#5193
From: Bert Peers
Date: Sun, 18 May 2003 13:28
16 lines
2088 bytes
Marcus wrote:

>>>>int TestBit(BYTE val, int intIndex)
>>>>{
>>>>    return ((val & (1 << intIndex)) > index) ? 1 : 0;
>>>>}
> val & (1 << intIndex))
> oplevert of de intIndexde bit van val 1 of 0 is, en dat gedeelte met >
> index zie ik het nut niet van in, zolang ik de context niet snap (index
> is kennelijk een globale variabele, maar waar staat die dan voor.

Wellicht voor een "negeer" masker.  Als index bv 0x0f is, gaan
de vier meest rechtse bits false opleveren, of ze nu gezet zijn
of niet.  Niet zo'n hippe code, dit.

Bert
Technical Details
Message-ID: <qULxa.79642$me2.8470398@amsnews02.chello.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.e.nsc.no!nsc.no!nextra.com!news01.chello.no!amsnews01.chello.com!amsnews02.chello.com.POSTED!53ab2750!not-for-mail
References: <CVJxa.7359$1u5.531@afrodite.telenet-ops.be> <3ec76e06$0$147$e4fe514c@dreader8.news.xs4all.nl> <3ec77f83$0$49105$e4fe514c@news.xs4all.nl> <3ec7891d$0$152$e4fe514c@dreader7.news.xs4all.nl>

Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit
X-Google-Thread: 107324,2cd6db1915f275ab
X-Google-Attributes: gid107324,public
X-Google-Thread: fcea4,2cd6db1915f275ab
X-Google-Attributes: gidfcea4,public
X-Google-ArrivalTime: 2003-05-18 06:32:09 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.e.nsc.no!nsc.no!nextra.com!news01.chello.no!amsnews01.chello.com!amsnews02.chello.com.POSTED!53ab2750!not-for-mail
From: Bert Peers <piek@ab.oo>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312
X-Accept-Language: en-us, en, ja
MIME-Version: 1.0
Newsgroups: be.comp.programming,nl.comp.programmeren
Subject: Re: VRAAGJE C/C++
References: <CVJxa.7359$1u5.531@afrodite.telenet-ops.be> <3ec76e06$0$147$e4fe514c@dreader8.news.xs4all.nl> <3ec77f83$0$49105$e4fe514c@news.xs4all.nl> <3ec7891d$0$152$e4fe514c@dreader7.news.xs4all.nl>
In-Reply-To: <3ec7891d$0$152$e4fe514c@dreader7.news.xs4all.nl>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 17
Message-ID: <qULxa.79642$me2.8470398@amsnews02.chello.com>
Date: Sun, 18 May 2003 13:28:54 GMT
NNTP-Posting-Host: 195.162.216.187
X-Complaints-To: abuse@chello.be
X-Trace: amsnews02.chello.com 1053264534 195.162.216.187 (Sun, 18 May 2003 14:28:54 WEST)
NNTP-Posting-Date: Sun, 18 May 2003 14:28:54 WEST
Organization: chello broadband
X-Received-Date: Sun, 18 May 2003 15:28:59 MET DST (news01.chello.no)