Answer the question
In order to leave comments, you need to log in
How to pass variables and arrays to a function?
There are 2 global arrays and a variable
var
mas, masX: array[0..5]of real;
x,y:real;
function Z(x: real): real;
begin
...
end;
function Z(a: real; var mas1,mas2:array of real): real;
begin
...
end;
y := function Z(x,mas,masX);
Answer the question
In order to leave comments, you need to log in
You specified a dynamic array in the method (mas1,mas2:array of real)
, but you want to pass a static one array[0..5]of real;
Define a static array as a type
type
TMyArray = array[0..5]of real;
var
mas, masX: TMyArray;
function Z(a: real; var mas1,mas2:TMyArray): real;
begin
...
end;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question