hi all,
I have a block of memory, and I am storing arbitrary number of basic types ( floats, ints, chars, and char* ( strings )) in this block of memory.
--------------------------------------
| int | int | float .....
--------------------------------------
When I want to access these variables, I use a pointer to the first byte of this memory block and an index, something like this
eg. to access the second int,
Code:
char* block_pointer = new char[1024];
...
...
// to access the second int
int second_int = *(block_pointer + sizeof(int));
my question is, would this approach produce undesired effects ( alignments problems )