My issue, i am trying to convert and array of dynamic memory of type DWORD to a BYTE. Fair enough i can for loop through this and convert the DWORD into a BYTE per entry.
But is their a faster way to do this? to take a pointer to DWORD data and convert the whole piece of data into a pointer to BYTE data? such as using a memcpy operation?
I feel this is not possible, im not requesting an answer just an experienced opinion on my approach, as i have tried testing both approaches but seem to fail getting to a solution on my second solution.
Thanks for any input, again no answers just a point in the right direction. Nor is this a homework question, i felt that had to be mentioned.
It really depends on what you’re trying to achieve in the end. If you’ve got, e.g:
And you just want to deal with each byte of each DWORD individually then doing something like you suggest (i.e. using e.g. memcpy) could be an option. You could, however, just deal with the array as a BYTE array usinga reinterpret_cast e.g.
Or something like that.