out size = 992
all_size = 990
в с++ размер 990. Подскажите, что не так?
import ctypes from ctypes import wintypes MAX_CLIENT_NAME = 80 MAX_CARD_LS_DATA = 800 MAX_HASH = 20 MAX_TRACK2 = 40 MAX_PAN_N = 19 class struct_out_reserved5(ctypes.Structure): _fields_ = [ ("size", wintypes.DWORD), ("Reserved1", ctypes.c_void_p), ("Hash", wintypes.BYTE * MAX_HASH), ("CardData", wintypes.BYTE * (MAX_TRACK2)), ("Balance", wintypes.DWORD), ("Currency", wintypes.DWORD), ("CardLCDataLen", wintypes.DWORD), ("CardLCData", wintypes.BYTE * (MAX_CARD_LS_DATA)), ("AuthCode", ctypes.c_char * (6+1) ), ("ClientName", ctypes.c_char * MAX_CLIENT_NAME), ("IsOwn", wintypes.BYTE), ("LltID", wintypes.BYTE), ("Flags", wintypes.BYTE), ("RealPan", ctypes.c_char * (MAX_PAN_N +1)) ] out = struct_out_reserved5() print('out size = ' + str(ctypes.sizeof(out))) all_size = 0 all_size = all_size + ctypes.sizeof(wintypes.DWORD) * 4 all_size = all_size + ctypes.sizeof(wintypes.BYTE) * 3 all_size = all_size + ctypes.sizeof(ctypes.c_void_p) all_size = all_size + ctypes.sizeof(wintypes.BYTE * MAX_HASH) all_size = all_size + ctypes.sizeof(wintypes.BYTE * (MAX_TRACK2)) all_size = all_size + ctypes.sizeof(wintypes.BYTE * (MAX_CARD_LS_DATA)) all_size = all_size + ctypes.sizeof(ctypes.c_char * (6+1)) all_size = all_size + ctypes.sizeof(ctypes.c_char * MAX_CLIENT_NAME) all_size = all_size + ctypes.sizeof(ctypes.c_char * (MAX_PAN_N +1)) print('all_size = ' + str(all_size))