【发布时间】:2019-12-28 02:40:21
【问题描述】:
我已经定义了一个这样的结构:
typedef struct __attribute__((packed)) {
UInt8 a;
UInt16 b;
UInt8 c[15];
} myStruct;
当我试图获得价值时
UInt8 c = packet->c;
我收到以下错误
指向使用“UInt8”类型表达式初始化“UInt8”(又名“unsigned char”)的整数转换指针不兼容 [15]
我需要转换成什么类型才能编译?我尝试在不同的地方添加 [15] 下标,但无法解决。还解释了[15] 在UInt8 c[15]; 中的含义
谢谢
【问题讨论】:
标签: ios objective-c struct type-conversion