Less used data (1 byte) in memory address holding 4 bytes [closed]
-
04-11-2019 - |
Question
I need to store two distinct variables of 1 byte size in memory.
My memory system stores 4 bytes at one address; therefore, you cannot address byte 3 directly, and you have to logically access it after all 4 bytes are fetched of that address (correct me if I'm wrong please).
So, if I assign the following two variables: char var1 = "a"
and char var2 = "b"
,
Will my system store them in memory at two different addresses?
Will 3 bytes in each of those addresses be useless (i.e., will the two variables occupy 8 bytes of memory)?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with cs.stackexchange