D
doglive
Unregistered / Unconfirmed
GUEST, unregistred user!
Function Equal(Var source,Dest;size:Integer);Boolean;
Type TBytes=Array[0..MaxInt-1] of byte ;
var N:Integer;
begin
N:=0;
while(N<size)and(TBytes(Dest)[N]=TBytes(soures)[N])do
Inc(N);
Equal:=N=size;
end;
下面有个调用的例子:
type TVector=Array[1..10] of Integer;
Tpoint=Record
x,y:integer;
End;
var vec1 ,vec2:TVextor;
N:Integer;
P:Tpoint;
...
Equal(vec1 ,vec2,sizeof(Tvector));
Equal(vec1,vec2,sizeof(Integer)*N);
Equal(Vec[1],vec[2],sizeof(Integer)*5);
Equal(vec1910,P,4);
请问后面的四个调用分别完成什么样的功能,请说明原因,多谢
Type TBytes=Array[0..MaxInt-1] of byte ;
var N:Integer;
begin
N:=0;
while(N<size)and(TBytes(Dest)[N]=TBytes(soures)[N])do
Inc(N);
Equal:=N=size;
end;
下面有个调用的例子:
type TVector=Array[1..10] of Integer;
Tpoint=Record
x,y:integer;
End;
var vec1 ,vec2:TVextor;
N:Integer;
P:Tpoint;
...
Equal(vec1 ,vec2,sizeof(Tvector));
Equal(vec1,vec2,sizeof(Integer)*N);
Equal(Vec[1],vec[2],sizeof(Integer)*5);
Equal(vec1910,P,4);
请问后面的四个调用分别完成什么样的功能,请说明原因,多谢