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;
2
  • The declaration of PageBuffer is missing, hopefully it's of type BYTE *, to which the address of Page is casted. See e.g. stackoverflow.com/questions/14769917/… Commented Dec 15, 2021 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. Commented Dec 17, 2021 at 19:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.