2 ms·
"it requires knowing the range of each value that you're storing in the struct (and not just the number of bits)." Many high-level languages require programmer
by Someone 11y ago
"it requires knowing the range of each value that you're storing in the struct (and not just the number of bits)."
Many high-level languages require programmers to specify what you want to store ('an integer between -6 and 43, inclusive'), not how ('6 bits'). That typically makes it possible for the compiler to do just that. For example, Pascal has the 'packed' keyword (http://www.gnu-pascal.de/gpc/packed.html http://www.gnu-pascal.de/gpc/packed.html)