1 program ptr0;
   2 
   3 // gfortran -c sub1.f to get sub1.o then the directive below will link the code
   4 {$L sub1.o}
   5 
   6 uses mtx09;
   7 
   8 procedure sub1_(var n:longint; x:pointer); cdecl; external;
   9 
  10 var
  11   a: mtx;
  12   n: longint;
  13 
  14 begin
  15   equ(a,'1 2 3; 4 5 6');
  16   mwr(a);
  17   n := lgn(a)*col(a);
  18   sub1_(n,ptr(a)); // NOTE the name appended with an underscore
  19   mwr(a)           // a linux linker convention
  20 end.
  21 {
  22 1   2   3
  23 4   5   6
  24 
  25 2   4   6
  26 8   10   12
  27 
  28 }