Question

How to create a pascal function that doesn't have any arguments and returns an array??

Was it helpful?

Solution 2

program Foo;
type
        TArray = array[0..9] of integer;
function newArray():TArray;
begin
end;

var
        arr:TArray;
begin
        arr:= newArray();
end.

OTHER TIPS

It was back then in turbo pascal 7, i don't think it would have changed.

type
 IntArray = array of Integer;

function MyArray():IntArray
begin
  MyArray:=[1,2,3];
end;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top