请问在DELPHI 中如何定义联合类型;
如在C 中定义为以下的联合:
union
{
    char a;
    char b;
}mychar;
在DELPHI 中如何定义?
请指教!谢谢!

解决方案 »

  1.   

    type  mychar = record
        case i of
          0: a:char;
          1: b:char;
      end;
      

  2.   

    C 中定义为以下的联合:
    union
    {
        char a;
        char b;
    }mychar;
    我覺得你如上的定義有問題!!!
      

  3.   

    谢谢 风舞轻扬如下定义就对了:
    type  mychar = record
        case Integer of
          0: a:char;
          1: b:char;
      end;
      

  4.   

    type 
     TMyType = record 
            case integer of 
              0:  iii:integer;
              1:  str:array [0..3] of char
             end
            end