Domanda

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

È stato utile?

Soluzione 2

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

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

Altri suggerimenti

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;
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top