構造体を含むunsignedcharポインターがあります。次に、次のことを実行します。
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.
私はここで何を間違っているのですか?