Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on Setting desired bit in a 32 bit number within the C and C++ forums, part of the Software Development category; Hi guys, how to set a particular desired bit in a 32 bit number...function should be of format... psedofunct (bit number to set or reset, number to operate on) NOTE ...
|
|||||||
|
|||
|
Setting desired bit in a 32 bit number
Hi guys, how to set a particular desired bit in a 32 bit number...function should be of format... psedofunct (bit number to set or reset, number to operate on)
NOTE : This question was asked by pratap, I am posting it in proper forum] |
| Sponsored Links |
|
|||
|
Re: Setting desired bit in a 32 bit number
guess you can use these macros.
#define SETBIT(bitnumber,number) (number)|(1<<(bitnumber-1)) #define RESETBIT(bitnumber,number) (number)&(~(1<<(bitnumber-1))) Hopefully this helps. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Find the next number | RyanJames | Brainteasers | 3 | 4 Weeks Ago 02:06 AM |
| find out the number. | jamesravid | Brainteasers | 7 | 01-25-2007 10:43 PM |
| 5 digit number.... | psuresh1982 | Brainteasers | 2 | 11-29-2006 12:49 AM |
| Can you find the number | SriramKrishna | Brainteasers | 4 | 10-25-2006 11:56 AM |
| Pick out the number | StephenRaj | Brainteasers | 2 | 08-23-2006 03:57 PM |