![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395115x1.png)
6
Table
Pascal Type | C Type | Size (bytes) | Alignment (bytes) |
|
|
|
|
array | array | - | Same as element type |
|
|
|
|
variant record | struct/union | - | - |
|
|
|
|
fields in packed | bit field | - | - |
record |
|
|
|
|
|
|
|
Table | |||
|
|
|
|
Pascal Type | C Type | Size (bytes) | Alignment (bytes) |
|
|
|
|
real | float | 4 | 4 |
|
|
|
|
integer | short int | 2 | 2 |
|
|
|
|
This section describes the precautions you should take when working with compatible types.
The shortreal TypeThe Pascal shortreal and C float compatibility works if you pass by reference. See “Value Parameters” on page 112 for examples that show you how to pass by value.
Character StringsC has several assumptions about strings. All C strings are:
•Passed by reference since C strings are arrays
•Terminated by a null byte
•Located in static variable storage
You can satisfy these assumptions as follows:
•Pass by reference by making the strings var, in, out, or in out parameters.
•Provide the null byte explicitly before passing a string to C. Pascal guarantees the null byte only if the string is a constant. The null byte is not required by the ISO Pascal Standard.
The | 91 |