我想定义一个二维的动态数组,请教各位如何定义
如何分配内存。
急急急急急急急急急急!!!!!!!!!!
如何分配内存。
急急急急急急急急急急!!!!!!!!!!
解决方案 »
- 突然发现升星了,放分祝贺
- 我怎么可以模拟按下其它程序上的按钮。如影音传送带中的“新建”和“确定(&O)”按钮?
- NMFtp上传到远程服务器,分不够再加
- 请问: 怎样屏蔽OleContainer的右键菜单呀?
- Rave Report5.0中的TRvProject裡的ProjectFile屬性要怎樣設置。那位知道請進1!!!
- 各位大虾:求助啊!关于Timer的使用!
- 谁能给我提供发送手机短信源程序啊,解决就结帐!!
- 初学者问题,简直在捡分
- 亲求帮助:如何在DBGRID中,用SHIFT加鼠标左键进行多选?
- 谁可以提供一些关于新闻组编程的资料!
- 连接acess表的ADOTABLE在打开field editor 提示 from子句错误?
- 处学DELPHI:招聘~~~~老师三位~~
type
TAI = array of integer;
TAAI = array of TAI;
var
a: TAAI;
n, m: integer;
Str: string;
begin
setlength(a, 10);
for n := low(a) to high(a) do
begin
SetLength(a[n], n + 1);
for m := low(a[n]) to high(a[n]) do
a[n][m] := m;
end; for n := low(a) to high(a) do
begin
Str := '';
for m := low(a[n]) to high(a[n]) do
Str := str + ', ' + IntToStr(a[n][m]);
Memo1.Lines.Add(Str);
end;
end;
The following example uses dynamic arrays (and the IntToStr function declared in the SysUtils unit) to create a triangular matrix of strings.var A : array of array of string;
I, J : Integer;
begin
SetLength(A, 10);
for I := Low(A) to High(A) do
begin
SetLength(A[I], I);
for J := Low(A[I]) to High(A[I]) do
A[I,J] := IntToStr(I) + ',' + IntToStr(J) + ' ';
end;
end;
arr: array of array of 类型
分配内存
SetLength(arr,x,y)//x,y为整数
继续设置SetLength(A, 15);
也可以