![]() |
| | #1 |
| Registered User Join Date: May 2009 Location: Chennai, India
Posts: 17
| Basic doubt in C structure I was navigating inside linux kernel code and inside that one i have seen few structures which are very strange (for me). The structure is of the following form Code: struct dummy {
int a:1;
unsigned long b:5;
};
Thanks in advance -BalaC- |
| cbalu is offline | |
| | #2 |
| Guest Join Date: Aug 2001
Posts: 4,923
| It's called a bitfield. |
| Sebastiani is offline | |
| | #3 |
| Making mistakes Join Date: Dec 2008
Posts: 347
| a is a bitfield (like an int or char, but with one bit). b too, but with five bits. "a = 2" will probably give 0, since the upper bits are chopped off. |
| Brafil is offline | |
![]() |
| Tags |
| struct, structure |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Structure and Linked List User Input Question | kevndale79 | C Programming | 16 | 10-05-2006 11:09 AM |
| structure ...solution plz???? | hegdeshashi | C Programming | 4 | 07-24-2006 09:57 AM |
| Binary Search Trees Part III | Prelude | A Brief History of Cprogramming.com | 16 | 10-02-2004 03:00 PM |
| Doubt -- Structures | bmsar | C Programming | 0 | 12-25-2002 11:55 PM |