我真的很感激,如果任何解釋可以給出下面的一段代碼的輸出。我不明白爲什麼sizeof(struct_2)和sizeof(my_struct_2)是不同的,提供sizeof(struct_1)和sizeof(c_int)是相同。 看來包裝struct在struct以不同的方式嗎? from ctypes import *
class struct_1(Structure):
pass
Python IDE(任何)智能感知如何在設計時發現結構成員? class MY_STRUCTURE(ctypes.Structure):
_fields_ = [("member1", c_int),
("member2", c_int)]
#Any idea declare the fields like self.member1 here insi