In another language I work with, I can make two variables of different data-types reference the same patch of memory. I'd do it like this:
StringVar cstring(10) -- a string variable LongVar long,over(StringVar) -- a 4-byte numeric variable
The "over" syntax causes the second variable to use the same first 4 bytes as the first. With this I can access the data stored there in two different ways:
So if I do this:
Stringvar='AA' & chr(0) & chr(0)
LongVar will = 16705 (65*256 + 65)
or I can do this:
and StringVar will = 'B'
Can I do this in Arduino C? Would I use "references" to accomplish this? I've been reading some posts about references but am getting confused.