M
M
Mars362021-07-12 22:30:07
Qt
Mars36, 2021-07-12 22:30:07

QByteArray to uint8_t*?

I'm trying to get uint8_t* from a byte array.
Tried like this

uint8_t* data = reinterpret_cast<uint8_t*>( byteArray.data() );

But at the output I get an empty uint8_t *. How to do it right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ighor July, 2021-07-13
@IGHOR

Your code is correct. Check the output method you are testing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question