Hi, this is an odd request but with some very useful applications. Is it possible to use pointers to assign more than one variable to the same location in memory? For example, to define two consecutive bytes in an array to be also accessible as a single two-byte int? Then, changing the contents of the bytes would change the int, and vice versa.
I'm imagining code that looks something like this:
byte Array[10]; // Define an array of 10 bytes
int *Integer = *Array[3]; // [Won't work!] Assign Integer as sharing location 3 (and 4) of the array
int Result;
Array[3] = 1;
Array[4] = 2;
Result = Integer; // Result would now be 258; ie 1*256 + 2
Integer = 513;
Result = Array[3]; // Result would now be 2; the upper byte of 513
Result = Array[4]; // Result would now be 1; the lower byte of 513