Pascal samples. Default parameters.


program Demo;

procedure Test(X: Integer; S: Single = 12.5;
               C: Char = 'W'; Str: String = 'abc');
begin
  writeln(X:10, S:10:2, ' ', C, ' ', Str);
end;

begin
  Test(5, 5, 'a', 'a');
  Test(5, 5, 'a');
  Test(5, 5);
  Test(5);
end.


Copyright © 2006-2017 Alexander Baranovsky. All rights reserved.