
September 30th, 2006, 11:23 AM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 1
Time spent in forums: 22 m 50 sec
Reputation Power: 0
|
|
|
Byte Array of int and char
Please help,
I want to make an array that will hold both ints and chars.
It will be like a memory emulator using an offset to get the next area of data.
mem[0] is a char, mem[0+offset] is a int, mem[0+offset] is a char.
I thought about using a union, but pulling the data out correctly doesn't work.
I also tried pointers with reinterpret_cast, but I am getting the type that was originally declared for the pointer.
So, what do I do? How would I declare the pointer to make sure I get the correct data from the array? And how would I handle the offset part?
Or ay other suggestions would be great.
-zbc
|