再说一句,与下边的语句相同,只不过更清晰一些罢了!!
static struct gendisk md_gendisk=
{
MD_MAJOR,
"md",
0,
1,
md_hd_struct,
md_size,
MAX_MD_DEVS,
NULL,
NULL,
&md_fops,
};
static struct gendisk md_gendisk=
{
MD_MAJOR,
"md",
0,
1,
md_hd_struct,
md_size,
MAX_MD_DEVS,
NULL,
NULL,
&md_fops,
};
struct CELL // Declare CELL bit field
{
unsigned character : 8; // 00000000 ????????
unsigned foreground : 3; // 00000??? 00000000
unsigned intensity : 1; // 0000?000 00000000
unsigned background : 3; // 0???0000 00000000
unsigned blink : 1; // ?0000000 00000000
} screen[25][80]; // Array of bit fields You see what? OK.
{
int aa;
int bb;
int cc;
};struct mystruct TheStruct =
{
aa:1,
bb:2,
};我觉得这个跟以上说的情况一样,怎么在VC中编译出错呢?
can see the following codes:struct CELL // Declare CELL bit field
{
unsigned character : 8; // 00000000 ????????
unsigned foreground : 3; // 00000??? 00000000
unsigned intensity : 1; // 0000?000 00000000
unsigned background : 3; // 0???0000 00000000
unsigned blink : 1; // ?0000000 00000000
} screen[25][80]; // Array of bit fields
看不懂,什么意思?
unsigned character : 8; // 00000000 ????????
unsigned foreground : 3; // 00000??? 00000000
unsigned intensity : 1; // 0000?000 00000000
unsigned background : 3; // 0???0000 00000000
unsigned blink : 1; // ?0000000 00000000
character占8位,foreground占3位,总共为16位
你看下面这句?
major_name: "md",CSDN好象现在高手很少了!
哎!
kingzai所说的是一种情况,我曾经做的一个自动化控制项目就是这样用的。