Click here to Skip to main content
15,890,185 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: variable of less than a byte Pin
ShilpiP22-May-08 20:55
ShilpiP22-May-08 20:55 
AnswerRe: variable of less than a byte [modified] PinPopular
Rajkumar R22-May-08 21:08
Rajkumar R22-May-08 21:08 
GeneralRe: variable of less than a byte Pin
ShilpiP22-May-08 21:28
ShilpiP22-May-08 21:28 
QuestionRe: variable of less than a byte Pin
chandu00422-May-08 21:50
chandu00422-May-08 21:50 
AnswerRe: variable of less than a byte Pin
CPallini22-May-08 22:08
mveCPallini22-May-08 22:08 
AnswerRe: variable of less than a byte Pin
ShilpiP22-May-08 22:33
ShilpiP22-May-08 22:33 
GeneralRe: variable of less than a byte Pin
chandu00424-May-08 2:52
chandu00424-May-08 2:52 
AnswerRe: variable of less than a byte Pin
Rajkumar R24-May-08 4:29
Rajkumar R24-May-08 4:29 
It seems you know the answer and just put as question, if my arrogant assumption is correct, why don't you share the knowledge instead, if not see below,


chandu004 wrote:
will nYear usethese two bits and remaining 6 bitsform other short or not?

No, Bit fields that cross the type boundary will skip bits to align the bitfield to the next type alignment, where type is the type of bitfield member. so, since nYear requires 8 bits and doesnot fit previous type (unsigned short - 16 bit) boundary, it skips to next 16 bit (unsigned short (type of nYear)) boundary. (PS: types other than int, like char, bool, short are not supported by every compiler.)
AnswerRe: variable of less than a byte Pin
Dan23-May-08 21:48
Dan23-May-08 21:48 
GeneralRe: variable of less than a byte Pin
toxcct22-May-08 23:37
toxcct22-May-08 23:37 
GeneralRe: variable of less than a byte Pin
Rajkumar R23-May-08 0:07
Rajkumar R23-May-08 0:07 
GeneralRe: variable of less than a byte Pin
Rajkumar R23-May-08 2:04
Rajkumar R23-May-08 2:04 
AnswerRe: variable of less than a byte Pin
toxcct22-May-08 23:41
toxcct22-May-08 23:41 
GeneralRe: variable of less than a byte Pin
rp_suman24-May-08 2:25
rp_suman24-May-08 2:25 
QuestionCString problem Pin
trioum22-May-08 20:26
trioum22-May-08 20:26 
AnswerRe: CString problem Pin
Cedric Moonen22-May-08 20:37
Cedric Moonen22-May-08 20:37 
GeneralRe: CString problem Pin
trioum22-May-08 20:51
trioum22-May-08 20:51 
GeneralRe: CString problem Pin
Cedric Moonen22-May-08 21:08
Cedric Moonen22-May-08 21:08 
GeneralRe: CString problem Pin
Rajesh R Subramanian22-May-08 21:24
professionalRajesh R Subramanian22-May-08 21:24 
GeneralRe: CString problem Pin
toxcct22-May-08 23:46
toxcct22-May-08 23:46 
GeneralRe: CString problem Pin
Rajesh R Subramanian23-May-08 0:35
professionalRajesh R Subramanian23-May-08 0:35 
GeneralRe: CString problem Pin
Rajesh R Subramanian29-Jul-08 21:18
professionalRajesh R Subramanian29-Jul-08 21:18 
GeneralRe: CString problem Pin
toxcct29-Jul-08 21:22
toxcct29-Jul-08 21:22 
GeneralRe: CString problem Pin
CPallini22-May-08 21:28
mveCPallini22-May-08 21:28 
GeneralRe: CString problem Pin
Cedric Moonen22-May-08 21:42
Cedric Moonen22-May-08 21:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.