このコードがコンパイルされない理由を誰かが説明できますか?
main.c
typedef struct ext2_group_desc
{
unsigned long bg_block_bitmap; /* Blocks bitmap block */
unsigned long bg_inode_bitmap; /* Inodes bitmap block */
unsigned long bg_inode_table; /* Inodes table block */
unsigned int bg_free_blocks_count; /* Free blocks count */
unsigned int bg_free_inodes_count; /* Free inodes count */
unsigned int bg_used_dirs_count; /* Directories count */
unsigned int bg_pad;
unsigned long bg_reserved[3];
} group_desc;
int main() {
char buf[1024];
group_desc gd;
gd = (group_desc) buf;
return(0);
}
「ターミナル」
$ bcc -ansi -c test.c
test.c:7.26: error: need scalar or pointer or void
test.c:7.26: error: assignment to/from struct/union of a different type
$