Windows SDK contains a set of typedefs:
typedef long LONG;
typedef struct tagPOINT
{
LONG x;
LONG y;
} POINT;
typedef struct tagRECT
{
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT;
then, there’s a WinAPI function that expects a pointer to an array of POINT structs and the length of that array:
void ThatFunction( POINT* points, int numberOfElements );
and we have the following code:
RECT rect = ...//obtained from somewhere
ThatFunction( reinterpret_cast<POINT*>( &rect ), 2 );
so that RECT is being treated as an array of two POINT structures.
Is such cast safe?
For this particular Win32 structure, yes. You should of course make this assumption explicit: