🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #9509

Re: Como acceder al bit x de un dato

#9509
From: José Antonio Calvo
Date: Mon, 17 Jun 2002 16:34
27 lines
2203 bytes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

El Mon, 17 Jun 2002 17:39:38 +0200, Angel escribi�:
> Suponiendo q tenemos un dato de n bytes, com podria acceder al bit x?? 
> en C o C++.
> 

Pues se me ocurre hacer un desplazamiento a la derecha de forma que el
bit que queremos comprobar quede como el de menos peso, que es el que
indica si es par (0) o impar (1) entonces seg�n su resto al dividirlo
por 2 se podr�a saber cual es su valor.

Un saludo.

- -- 
Jos� Antonio Calvo <josh@escomposlinux.org>
Linux Registered User #194638
Powered by Debian GNU/Linux sid
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9Dg95EY/neweI71kRAv1VAKCQ53ugJ9z97Dq7ZJkSjka1igTi1gCdFF70
SrKFnbgwxALRjrrym+i+0+A=
=RRo0
-----END PGP SIGNATURE-----
Technical Details
Message-ID: <slrnags3rk.1ij.josh@monegrux.micasa>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!nsnmpen1-lo.nuria.telefonica-data.net!nsnmpen2-lo.nuria.telefonica-data.net!frodo.antakira.com!212.25.139.151!news.audiolis.com!217.127.183.203!eriador.escomposlinux.org!marmolejo.escomposlinux.org!antonio.escomposlinux.org!127.0.0.1!nobody
References: <aekvlb$81hpu$1@ID-148170.news.dfncis.de>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,8245fc4b08721416
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2002-06-17 10:02:06 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!nsnmpen1-lo.nuria.telefonica-data.net!nsnmpen2-lo.nuria.telefonica-data.net!frodo.antakira.com!212.25.139.151!news.audiolis.com!217.127.183.203!eriador.escomposlinux.org!marmolejo.escomposlinux.org!antonio.escomposlinux.org!127.0.0.1!nobody
From: José Antonio Calvo <josh@monegrux.micasa>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Como acceder al bit x de un dato
Date: Mon, 17 Jun 2002 18:34:01 +0200
Organization: ecolnet
Lines: 27
Sender: josh@193-152-74-242.uc.nombres.ttd.es
Message-ID: <slrnags3rk.1ij.josh@monegrux.micasa>
References: <aekvlb$81hpu$1@ID-148170.news.dfncis.de>
Reply-To: josh@escomposlinux.org
NNTP-Posting-Host: 225.red-80-34-119.pooles.rima-tde.net
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: nsnmpen2-gest.nuria.telefonica-data.net 1024333322 6990 80.34.119.225 (17 Jun 2002 17:02:02 GMT)
X-Complaints-To: usenet@nsnmpen2-gest.nuria.telefonica-data.net
NNTP-Posting-Date: Mon, 17 Jun 2002 17:02:02 +0000 (UTC)
User-Agent: slrn/0.9.7.4 (Linux)