0

What does the syntax of the following cast to an object Page of struct WHISPERPACKET mean

typedef struct
{
    unsigned char uchData[512];
    unsigned char uchType;
    unsigned char uchInfo;
    unsigned short unSampleRate;
    unsigned short unSamples;
}WHISPERPACKET;
typedef unsigned char       BYTE;
WHISPERPACKET Page;


PageBuffer = (BYTE*)&Page;

edit:

BYTE* PageBuffer;
Omar
  • 164
  • 10
  • The declaration of `PageBuffer` is missing, hopefully it's of type `BYTE *`, to which the address of `Page` is casted. See e.g. https://stackoverflow.com/questions/14769917/when-to-use-unsigned-char-pointer – Bob__ Dec 15 '21 at 13:55
  • The cast is not applied to the object `Page`, but to a `Page*` pointer `&Page`. The goal is likely to access the underlying storage of `Page` as an array of bytes. – Igor Tandetnik Dec 17 '21 at 19:47

0 Answers0