I am facing a memory problem.
I have defined an array of size 2048 in a structure, which is of type uint8.
Now in runtime I want to retypecast the same array into either uint16 or uint32 depending on how big my array element is.
If I retypecast it to uint16 I expect that I will be able to store just 1024 instead of 2048 elements, and this way I can avoid allocating the whole length for uint32 element size, which will be four times of the current size.
I have tried with void typecasting to int but it gives error because I am indexing the array elements while storing and retireving elements.
Can anyone help?