template<typename type>
class CData
{
public:
DWORD a;
DWORD b;
DWORD c;
type* m_Data() { return (type*)(this + 1); }
};
Note: Used old school cast to make my code more readable.
DWORD Data[] = { 0, 0, 0, 0 };
CData<type>* nulldata = (CData<type>*)&data;
type *wti = (type*)(((BYTE*)&data) + sizeof(CData<type>));
Are these cast safe?
class CData
{
public:
DWORD a;
DWORD b;
BYTE* m_Data() { return (BYTE*)(this + 1); }
}
DWORD Data[] = { 0, 0, 0 };
CData* nulldata = (CData*)&data;
Do I avoid structure padding if I do this? Is structure padding even a issue?