Thanks. The one you showed work! However, I still encounter the following problem:
StrPrintF(msg, "%02X", byCheckSum); Assuming byCheckSum = 0xB9 Instead of printing the string "B9", it printed "000000B9". Please let me know how to fix this problem. Thanks. --- Joe <[EMAIL PROTECTED]> wrote: > --- Phong Nguyen wrote: > > What I want to do is: > > char buffer[100]; > > char* message = buffer; > > int index = 0; > > buildHeader (&message[index]); > > index += sizeof(HeaderType); > > assembleData (&message[index]); > > index += 10; > > ... > > You haven't really explained why you want this, but > assuming you must > have it, use the following: (Read the "CodeWarrior > C Compilers > Reference" for more info about pragmas.) > > #pragma options align=packed > // your structures defined here > #pragma options align=reset > > > ... and so if > > sizeof(..) does not return the correct value > ....my > > feeling for CodeWarrior would be > "!%$##@!#$%!@#%^$&*" > > sizeof() *does* return the correct value, just not > the value you > expected. (No need to swear at CW!) > > (This is probably the last thing I will say about > this topic because I > have used the wrong terminology in each of my last 2 > posts and so I > seem to be just confusing the matter.) > > HTH > > > __________________________________________________ > Do You Yahoo!? > Great stuff seeking new owners in Yahoo! Auctions! > http://auctions.yahoo.com > > -- > For information on using the Palm Developer Forums, > or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/ __________________________________________________ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
