C cnhbclg Unregistered / Unconfirmed GUEST, unregistred user! 2006-03-17 #1 例如:字符数组 a: array [0..9] of char; 当我想整体使用这个数组的10个字符时怎样引用。比如,我想把一次将数组中的所有字符赋值给一个字符串变量。
S shandongxintaix Unregistered / Unconfirmed GUEST, unregistred user! 2006-03-17 #3 注意将字符串的末尾家#0(字符串结束标志。)
L liuchong Unregistered / Unconfirmed GUEST, unregistred user! 2006-03-17 #4 var A:array[0..4] of Char; S:String; begin A[0]:='a'; A[1]:='b'; A[2]:='c'; A[3]:='d'; Pointer(S):=@A; ShowMessage(S); end;
var A:array[0..4] of Char; S:String; begin A[0]:='a'; A[1]:='b'; A[2]:='c'; A[3]:='d'; Pointer(S):=@A; ShowMessage(S); end;
F fsldg Unregistered / Unconfirmed GUEST, unregistred user! 2006-03-17 #5 procedure TForm1.Button1Click(Sender: TObject); var a: array [0..9] of char; b:string; begin a[0]:='g'; a[1]:='h'; b:=a; showmessage(b); end;
procedure TForm1.Button1Click(Sender: TObject); var a: array [0..9] of char; b:string; begin a[0]:='g'; a[1]:='h'; b:=a; showmessage(b); end;