I'm trying to use static_cast
to convert uint8_t*
to Some_Type_T*
where Some_Type_T
is a struct
.
SomeType_T* pTarget = static_cast<SomeType_T*>(pData)
That gives me an error
invalid static_cast from type 'uint8_t [1000] {aka unsigned char [1000]}' to type 'Some_Type_T*'
Basically what I'm trying to achieve is to map a buffer (byte array) to some structure.
I have done this many times with the C-like cast. But I though static_cast<>
is safer.
Could you give me a hint as to why this does not work?