再说一句,与下边的语句相同,只不过更清晰一些罢了!!
static struct gendisk md_gendisk=
{
MD_MAJOR,
"md",
 0,
 1,
 md_hd_struct,
 md_size,
 MAX_MD_DEVS,
 NULL,
 NULL,
 &md_fops,
};

解决方案 »

  1.   

    Very good. In addition, please see -- from MSDN
    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.
      

  2.   

    那么我下面的语句在VC里面怎么编译不能通过?struct mystruct
    {
      int aa;
      int bb;
      int cc;
    };struct mystruct TheStruct =
    {
      aa:1,
      bb:2,
    };我觉得这个跟以上说的情况一样,怎么在VC中编译出错呢?
      

  3.   

    It's just for static structure assignment. Maybe you 
    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 
      

  4.   

    在你的前面加上一个static 再把cc的也加上看看还会不会错!
      

  5.   

    前面加上了static 而且cc也加上去了,还是错。
      

  6.   

    111222(www.mozilla.org)
    看不懂,什么意思?
      

  7.   

    冒号是位域符号,:后面的整数表示所占的位数,比如
    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位
      

  8.   

    你没看错吧?位域符还有用字符标识的??
    你看下面这句?
    major_name: "md",CSDN好象现在高手很少了!
    哎!
      

  9.   

    在VC中有这样的用法
    kingzai所说的是一种情况,我曾经做的一个自动化控制项目就是这样用的。