hello guys,
i'm facing a difficulty in creating a matrix in pascal, the compiler keeps posting the messeges illegal qualifier at the line 28,7 where i wrote read(M[i,j]), and telling types mismatch coz i declared M is from type Matrice that i defined and then in the procedure Lect2d i declared it an array of longint but i did this bcoz i can't declare it as Matrice because when i'll use in other programmes whee Matrice is an "unknown" type it won't work, here's the code, PLEASE help what to do??
program test_lect2d;
uses crt;
const Max1=2000000000;
Max2=2000000000;
type Matrice= array of [1..Max1,1..Max2] of longint;
var M:Matrice;
T1,T2: longint;
procedure lect2d(var M: array of longint; Var T1,var T2: longint);
{****************************************************************************}
{cette pocedure lit un tableau a deux dimension dont les elements sont
des entiers }
{****************************************************************************}
var i,j: longint;
Begin
writeln('donnez les dimentions de votre matrice');
readln(T1);
readln(T2);
for i := 1 to T1 do
for j :=1 to T2 do
begin
writeln('M[',i,',',j,']=');
read(M[i,j]);
end;
end;
BEGIN
lect2d(M,T1,T2);
readln;
END.