擅长:python、mysql、java
<p>枚举:语言中没有枚举。人们提出了各种各样的习语,但没有一个是真正广泛使用的。最直接的(在本例中是充分的)解决方案是</p>
<pre><code>TEEG_EVENT_TAB1 = 1
TEEG_EVENT_TAB2 = 2
</code></pre>
<p>联合体:<a href="http://docs.python.org/py3k/library/ctypes.html" rel="noreferrer">ctypes</a>具有<a href="http://docs.python.org/py3k/library/ctypes.html#structures-and-unions" rel="noreferrer">unions</a>。</p>
<p><code>fieldname : n</code>语法称为位字段,是的,它的意思是“这是n位大”。同样,ctypes有<a href="http://docs.python.org/py3k/library/ctypes.html#bit-fields-in-structures-and-unions" rel="noreferrer">them</a>。</p>