我有一个包含结构的无符号字符指针。现在我想做以下事情
unsigned char *buffer ;
//code to fill the buffer with the relavent information.
int len = ntohs((record_t*)buffer->len);
其中 record_t 结构包含一个名为 len 的字段。我无法这样做并且收到错误。
error: request for member ‘len’ in something not a structure or union.
我在这里做错了什么?