若用数组名作为函数调用时的实参,则实际上传递给形参的是?
2个回答
展开全部
如果在PASCAL中用数组作形参则要新定义一种类型。
type ing:array[0..100] of longint;
procedure t:(a:ing);
var i:longint;
begin
for i:=1 to n do a[i]:=i;
end;
var n,i:longint;
a:ing;
begin
readln(n);
t(a);
for i:=1 to n-1 do write(a[i],' ');
writeln(a[n]);
end.
十分痛苦!!!!!
type ing:array[0..100] of longint;
procedure t:(a:ing);
var i:longint;
begin
for i:=1 to n do a[i]:=i;
end;
var n,i:longint;
a:ing;
begin
readln(n);
t(a);
for i:=1 to n-1 do write(a[i],' ');
writeln(a[n]);
end.
十分痛苦!!!!!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询