Compiler Error C2365

cannot initialize pointer at odd offset

An assignment statement is trying to assign a pointer to an address at an odd offset. Assignments can assign only even-offset addresses to pointer variables.

To fix this, ensure that pointer variables are assigned even offset addresses when dealing with addresses on forced alignments.

As an example of how this condition might arise, consider the following statements:

int i;
#pragma pack(1)
struct 
{
   char c;
   int *p;
} s = {'a', &i};

The structure member p lies on an odd offset address, which is then assigned the address value for i.