有一c中的数组要在delphi中实现
har a[]={0,1,2,3,4,5,6,7,8,9,12,10,15,11,14,13}; 在delphi中应怎样写??
我这要写是错的
Const a:Array[0..15] of char =('0','1','2','3','4','5','6','7','8','9','12','10','15','11','14','13') ;
说char 和string ;

解决方案 »

  1.   

    const a: array[0..15] of string =('0','1','2','3','4','5','6','7','8','9','12','10','15','11','14','13') ;你改成string类型的就行了。
      

  2.   

    靠,楼上的有这样的道理啊!这样太费空间了
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;const
      chararray :array [0..15] of char =('0','1','2','3','4','5','6','7','8','9','C','A','F','B','E','D') ;type
      TForm1 = class(TForm)
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}end.
      

  3.   

    a:array[0..15] of char=(#0,#1,#2,#3,#4,#5,#6,#7,#8,#9,#12,#10,#15,#11,#14,#13);
      

  4.   

    如果你不想用ABCDE表代替的情况下:
      chararray :array [0..15] of string[2] =('0','1','2','3','4','5','6','7','8','9','C','A','F','B','E','D') ;
      

  5.   

    应该是:Const a:Array[0..15] of string[2] =('0','1','2','3','4','5','6','7','8','9','12','10','15','11','14','13') ;
      

  6.   

    char a[]={0,1,2,3,4,5,6,7,8,9,12,10,15,11,14,13}; 像这种定义,相当于byte数组,并不是平常的‘1’,‘2’这种字符,不知道楼主到底要的是什么数组