Path: utzoo!attcan!uunet!ns-mx!iowasp.physics.uiowa.edu!maverick.ksu.ksu.edu!zaphod.mps.ohio-state.edu!usc!snorkelwacker!ira.uka.de!smurf!nadia!ananke!kaiser From: kaiser@ananke.stgt.sub.org (Andreas Kaiser) Newsgroups: comp.lang.c Subject: Help!!!! Message-ID: <13.26FB0A70@ananke.stgt.sub.org> Date: 21 Sep 90 07:26:00 GMT Organization: Ananke, Stuttgart, FRG Lines: 15 In a message of , hamid misnan (acs17111@uop.edu ) writes: hm> Can someone help me in how can I swap bit 2 and 5, I had tried hm> to use bitwise, but I cannot finger it out how it will work. hm> Any help will be appreciated. hm> Thanks in advance. #define Bit(n) (1 << (n)) i = (i & ~(Bit(2)|Bit(5))) | (i & Bit(5)) >> 5-2 | (i & Bit(2)) << 5-2; -- :::::::::::::::::::: Internet: kaiser@ananke.stgt.sub.org :: Andreas Kaiser :: Fidonet: 2:507/18.7206 (+ 2:509/5.2512) ::::::::::::::::::::