![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395117x1.png)
6
In Pascal, a set type is implemented as a bit vector, which is similar to a C
ceiling( ord( highest_element ) / 16 )
Direct access to individual elements of a set is highly
General Parameter Passing in C and Pascal
A few general rules apply to parameter passing:
•C passes all arrays by reference since C strings are arrays.
•C passes all structures by value.
•In C, if you want to pass anything else by reference, then you must explicitly prepend the reference ampersand (&), or pass an explicit pointer.
•Pascal passes all parameters by value unless you explicitly state that they are var, in out, or out parameters, in which case they are passed by reference.
Procedure Calls: C–Pascal
Here are examples of how a C main program calls a Pascal procedure:
The Pascal procedure, Samp, in the file Samp.p. Note the procedure definition.
procedure Samp(var i: integer; var r: real); begin
i := 9; r := 9.9
end; { Samp }
The | 93 |