Memory layout of a data structure: Difference between revisions

Line 175:
 
=={{header|Python}}==
This task cannot really be done efficiently in Python, as there is no type analogous to bit fields. The
<pre>
code below merely defines a dictionary with the pin names corresponding to entries in the dictionary.
# Controlling Fields in a Structure in Python
 
# This task is easily accomplished with the use of a Python dictionary.
<python># Controlling Fields in a Structure in Python
 
rs232 = {
Line 204 ⟶ 205:
}
 
#assignation and retrieval of data is trivial
 
rs232["RD Received data"] = 1
print rs232["TC Transmit clock"]</python>
</pre>
Anonymous user