笔记本电脑关机托运:pascal中的fillchar在C中是什么?(包括函数头)

来源:百度文库 编辑:高考问答 时间:2024/04/28 06:35:09
我是要翻译这个语句:
fillchar(countline,sizeof(countline),0);
不知道怎么翻。哪个高手帮忙一下!

要么把下面整篇翻一下。。。呵呵。。。

begin
assign(input,'medic.in');
reset(input);
readln(t,m);
for i:=1 to m do
readln(med[i].time,med[i].price);
close(input);
end;
procedure outdata;
begin
assign(output,'medic.out');
rewrite(output);
writeln(ans);
close(output);
end;
procedure count;
var
i,j,k:longint;
begin
fillchar(countline,sizeof(countline),0);
for i:=1 to m do
for j:=t downto 1 do
begin
if (j>=med[i].time) and (med[i].price+countline[j-med[i].time]>countline[j]) then
countline[j]:=med[i].price+countline[j-med[i].time];
end;
ans:=countline[t];
end;
begin
indata;
count;
outdata;
end.

fillchar(countline,sizeof(countline),0);
翻译成
memset(countline,0,sizeof(countline))

如果有必要翻译的,发消息给我。