我已经用两个具有相同数据类型的参数制作了一个函数,对此我没有任何问题。
但是我在使用不同的数据类型时遇到了麻烦
这是我的代码:
uses crt;
function inputscore(name : string, score:integer) : integer;
begin
writeln('My name is ',name,' and my score is ',score);
inputscore:=0;
end;
begin
clrscr;
inputscore('David',98);
readkey;
end.
Run Code Online (Sandbox Code Playgroud)
但是它返回了此错误消息:
multipleparameterfunc.pas(2,34)Fatal syntax error, ")" expected but "," found