From: Sebastian Huber <sebastian-huber@web.de>
To: gcc-help@gcc.gnu.org
Subject: Re: c++, gcc3.2.2 and bitwise operations
Date: Wed, 19 Feb 2003 11:56:00 -0000 [thread overview]
Message-ID: <200302191252.46259.sebastian-huber@web.de> (raw)
In-Reply-To: <43834.64.169.83.2.1045618399.squirrel@webmail01.get2chip.com>
On Wednesday 19 February 2003 02:33, Chris Croswhite wrote:
> How can I play with the guts of a variable one bit at a time in c++? That
> is, I want to do something like this,
>
> long long val =0x4000000000000001;
> ((int*)(&val)[1]) &= 0x0;
>
> (this should set the first bit to zero).
> [...]
Hi,
the standard way to to this is:
val &= ~(0x1LL)
Bye
next prev parent reply other threads:[~2003-02-19 11:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-19 1:36 Chris Croswhite
2003-02-19 11:56 ` Sebastian Huber [this message]
2003-02-19 12:25 ` Nathan Sidwell
2003-02-19 13:08 ` John Love-Jensen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200302191252.46259.sebastian-huber@web.de \
--to=sebastian-huber@web.de \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).