From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14335 invoked by alias); 19 Feb 2003 01:36:05 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 14327 invoked from network); 19 Feb 2003 01:36:05 -0000 Received: from unknown (HELO mail.get2chip.com) (64.169.83.2) by 172.16.49.205 with SMTP; 19 Feb 2003 01:36:05 -0000 Message-ID: <43834.64.169.83.2.1045618399.squirrel@webmail01.get2chip.com> Date: Wed, 19 Feb 2003 01:36:00 -0000 Subject: c++, gcc3.2.2 and bitwise operations From: "Chris Croswhite" To: Reply-To: ccroswhite@get2chip.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2003-02/txt/msg00162.txt.bz2 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). This worked with gcc 2.95.x, but I understand now that the casting (&val)[1] (to an array) is "undefined" and therefore not predictible. Could anyone give me hand? TIA, Chris