   very weird structure error (possible MICROSOFT compiler bug?)
  I've been having a very weird bug that make my app hang:I have a class done in this way:#pragma pack(16)class   {   struct XXX  { whatever }  arrayXXX[16];   struct YYY  { whatever }  arrayYYY[100];   ... other functions   }#pragma pack()When I compile this, in theory the compiler (MSVC++ 7.0) should place pointers of structures of XXX and YYY in a way that every array has its exclusive memory buffer.What is happening to me is that somewhat, the compiler is partially merging the two arrays, so, if I access arrayXXX[15] I found the same data written in arrayYYY[2], like if the end of the XXX array shares the same memory of the beginning of YYY array.I done an extensive study on the case, and I confirmed that with different methods, including getting the absolute memory pointers and comparing the size difference.Someone knows what could be causing this???Also, I'm trying to use the microsoft debugger, but I don't know how to see data strucure values, or how to set a breakpoint in data.thanks in advance[edited by - vicviper on August 4, 2003 5:54:04 AM]
  its not a bug, if u align data to 16bit and then let the compiler do pointerarythmetic with 32bit! you are the one causing the error (the compiler does not have to track the alighnment of your data )3ways to solve:-use pack before accessing with same values:-use one pack and dont change it anymore-or do your pointermath by yourself (((char *)&array) + sizeof(array)* index)T2k ;  ok, thanks, this has solved the problem