我在C++中轻松实现的问题,为什么在Delphi中总是编译出错,如下:
BufIn: Array[0..2000] of Byte;
BufIn:=($FF,$D8,$FF,$E0,0,$10,$4A,$46,$49,$46,0,1,1,1,0,$64);
各位大侠请指教!Thanks,

解决方案 »

  1.   

    beta :array[1..3] of real=(0.1,0.2,0.3);
    要注意保持元素个数一致。
      

  2.   

    主要元素太多了,写一个元素少的数组的元素逐一录入,不知道是否能帮你----------------------------------------
    var // (全局)
      b : Boolean ;
      BufIn: Array[0..20] of Byte ;
      i : Integer ;  FormCreate :    b := False ;
        i := -1 ;  逐一录入 :    b := True ;
        while b do
        begin
          Inc(i) ;
          BufIn[i] := StrToInt(Edit1.Text) ;
          Application.ProcessMessages ;
          b := False ;
        end ;
      

  3.   

    上面兄台说的对,
    BufIn: Array[0..2000] of Byte;     // 声明有2001个元素
    BufIn:=($FF,$D8,$FF,$E0,0,$10,$4A,$46,$49,$46,0,1,1,1,0,$64);
                                      // 但是,这赋值却只有十来个
    这样在DELPHI中行不通.