sachinkp21587
Member level 2
- Joined
- Mar 15, 2010
- Messages
- 51
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Location
- india (U.P.)
- Activity points
- 1,703
struct {
unsigned int audio1 : 3;
unsigned int audio2 : 3;
unsigned int audio3 : 3;
unsigned int audio4 : 3;
unsigned int audio5 : 3;
unsigned int audio6 : 3;
unsigned int audio7 : 3;
unsigned int audio8 : 3;
unsigned int audio9 : 3;
unsigned int audio10 : 3;
unsigned int audio11 : 3;
unsigned int audio12 : 3;
unsigned int audio13 : 3;
unsigned int audio14 : 3;
unsigned int audio15 : 3;
unsigned int audio16 : 3;
} MutingDelay;
struct {
unsigned int audio1 : 3;
unsigned int audio2 : 3;
unsigned int audio3 : 3;
unsigned int audio4 : 3;
unsigned int audio5 : 3;
}MutingDelay;
unsigned int audio1 : 3;
unsigned int audio2 : 3;
unsigned int audio3 : 3;
unsigned int audio4 : 3;
unsigned int audio5 : 3;
// 15 bit have been filled, the next three bits can't fit in the one bit left so they are allocated in the next integer space
unsigned int audio6 : 3;
unsigned int audio7 : 3;
unsigned int audio8 : 3;
unsigned int audio9 : 3;
unsigned int audio10 : 3;
// 15 bit have been filled, the next three bits can't fit in the one bit left so they are allocated in the next integer space
unsigned int audio11 : 3;
unsigned int audio12 : 3;
unsigned int audio13 : 3;
unsigned int audio14 : 3;
unsigned int audio15 : 3;
// 15 bit have been filled, the next three bits can't fit in the one bit left so they are allocated in the next integer space
unsigned int audio16 : 3;
Then if unsigned int is 16 bits thn it should take 2 bytes, but its taking 3 bytes. Why?
according to me the following code structure should take 6 byte i.e. (3bits *16variable)/8bits but in practical case its taking 8 bytes.
how?
i am using mplab c18
even if i am trying
Then if unsigned int is 16 bits thn it should take 2 bytes, but its taking 3 bytes. Why?
//1st 8 bit
unsigned int audio1 : 3;
unsigned int audio2 : 3;
//2nd 8 bit
unsigned int audio3 : 3;
unsigned int audio4 : 3;
//3rd 8 bit
unsigned int audio5 : 3;
unsigned int audio6 : 3;
//4th 8 bit
unsigned int audio7 : 3;
unsigned int audio8 : 3;
//5th 8 bit
unsigned int audio9 : 3;
unsigned int audio10 : 3;
//6th 8 bit
unsigned int audio11 : 3;
unsigned int audio12 : 3;
//7th 8 bit
unsigned int audio13 : 3;
unsigned int audio14 : 3;
//8th 8 bit
unsigned int audio15 : 3;
unsigned int audio16 : 3;
//1st 8 bit
unsigned int audio1 : 3;
unsigned int audio2 : 3;
//2nd 8 bit
unsigned int audio3 : 3;
unsigned int audio4 : 3;
//3rd 8 bit
unsigned int audio5 : 3;
Second code takes 10 bytes.
hey mathespbe why second code also take 8 byte i don't understand please tell me?
i understand that 's a reason but in post #8 u posted both 8 byte but second one is only took 3 byte right ?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?