呵呵 还可以Array['a'..'z'] of char;http://lysoft.7u7.net
当然还可以这样 var array of char;
type CDSDNFANS = (cfAD,cfWGYKING,cfihihonline,cfduxin,cfwg007) var D: array[cfAD..cfwg007] of Char;
type TTable= array [1..25,1..25] of Double; var table1:TTable;
这是pascal语法中数组的特点,而c中总是从0开始的
array[false..true] of Integer 见过么?
不学 Pascal,直接用 delphi,悲哀。
var A: array (.Boolean.) of Byte;
type aset=(aa,bb,cc);var f:array[aset] of byte; begin f[aa]:=1; f[bb]:=2; f[cc]:=3; end;
type aset=(aa,bb,cc); Trec=record r1:byte; r2:byte; end; const f:array[aset] of Trec=((r1:1;r2:2),(r1:3;r2:4),(r1:5;r2:6)); var s:aset; begin for s:=low(aset) to high(aset) do showmessage(inttostr(f[s].r1)+','+inttostr(f[s].r2)) end;
To: zswang(伴水清清)(专家门诊清洁工) var A: array (.Boolean.) of Byte;真没见识过,为啥可以这样定义阿?为啥只保存Boolean值啊?迷惑中……
楼上的:Equivalent symbols Special symbol Equivalent symbols [ (. ] .) { (* ] *)
The left bracket [ is equivalent to the character pair of left parenthesis and period (. The right bracket ] is equivalent to the character pair of period and right parenthesis .) The left brace { is equivalent to the character pair of left parenthesis and asterisk (*. The right brace } is equivalent to the character pair of right parenthesis and asterisk *)
还可以Array['a'..'z'] of char;http://lysoft.7u7.net
var
array of char;
CDSDNFANS = (cfAD,cfWGYKING,cfihihonline,cfduxin,cfwg007)
var
D: array[cfAD..cfwg007] of Char;
TTable= array [1..25,1..25] of Double;
var
table1:TTable;
见过么?
A: array (.Boolean.) of Byte;
aset=(aa,bb,cc);var
f:array[aset] of byte;
begin
f[aa]:=1;
f[bb]:=2;
f[cc]:=3;
end;
aset=(aa,bb,cc);
Trec=record
r1:byte;
r2:byte;
end;
const
f:array[aset] of Trec=((r1:1;r2:2),(r1:3;r2:4),(r1:5;r2:6));
var s:aset;
begin
for s:=low(aset) to high(aset) do
showmessage(inttostr(f[s].r1)+','+inttostr(f[s].r2))
end;
A: array (.Boolean.) of Byte;真没见识过,为啥可以这样定义阿?为啥只保存Boolean值啊?迷惑中……
Special symbol Equivalent symbols
[ (.
] .)
{ (*
] *)
The right bracket ] is equivalent to the character pair of period and right parenthesis .)
The left brace { is equivalent to the character pair of left parenthesis and asterisk (*.
The right brace } is equivalent to the character pair of right parenthesis and asterisk *)
Edit1.text[i]
i取不同的值就相当于字符串内容里同的第几个字节
赐教了!TO: MY128(清水晶)
字符串也算是数组了!揭帖!
MyClass& MyClassArray::operator [](int index//bool index,float index..);//还是c++灵活