X
xingsx
Unregistered / Unconfirmed
GUEST, unregistred user!
var
Buffer:array[1..BUFFER_LENGTH] of String
Count: longint
procedure Append(str:string)
begin
if count=BUFFER_LENGTH then
begin
Pointer(Buffer[1]):=nil
//<-Buffer[1]占用的空间是否被自动释放?
move(Buffer[2],Buffer[1],Sizeof(String)*(count-1))
Pointer(Buffer[count]):=nil
Buffer[count]:=str
end else begin
inc(count)
Buffer[count]:=str
end
end;
如果不能被释放,该如何释放?
Buffer:array[1..BUFFER_LENGTH] of String
Count: longint
procedure Append(str:string)
begin
if count=BUFFER_LENGTH then
begin
Pointer(Buffer[1]):=nil
//<-Buffer[1]占用的空间是否被自动释放?
move(Buffer[2],Buffer[1],Sizeof(String)*(count-1))
Pointer(Buffer[count]):=nil
Buffer[count]:=str
end else begin
inc(count)
Buffer[count]:=str
end
end;
如果不能被释放,该如何释放?