program ptr0;

// gfortran -c sub1.f to get sub1.o then the directive below will link the code
{$L sub1.o}

uses mtx09;

procedure sub1_(var n:longint; x:pointer); cdecl; external;

var
  a: mtx;
  n: longint;

begin
  equ(a,'1 2 3; 4 5 6');
  mwr(a);
  n := lgn(a)*col(a);
  sub1_(n,ptr(a)); // NOTE the name appended with an underscore
  mwr(a)           // a linux linker convention
end.
