 |
 |
 |
 |
 |
 |
 |
 |
|
|
 |
Call by
value
|
|
Pascal C/C++
|
|
|
|
|
 |
 |
 |
 |
 |
procedure
p(x : integer);
|
|
var
|
|
|
temp: integer;
|
|
|
begin
|
|
|
….
|
|
|
end;
|
|
|
|
 |
 |
 |
 |
 |
ANSI C/C++:
|
|
void p(int x)
|
|
|
{ int temp;
|
|
|
….
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
|
|
 |
|
|
|
 |
 |
NOTE: In either dialect, the return a
statement is optional
|
at the end of
the code. A return statement or statements
|
|
may also appear in the
middle of the code.
|
|
|
|
|