![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395170x1.png)
7
The commands to compile and
execute DaysOfWeek.p and DaysOfWeekMain.cc without
the
The commands to compile and execute DaysOfWeek.p and DaysOfWeekMain.cc withthe
hostname% pc
hostname% CC DaysOfWeek.o DaysOfWeekMain.cc
Day = ''
hostname% pc
hostname% CC DaysOfWeek.o DaysOfWeekMain.cc
Day = 'Sunday'
Records and Structures
A Pascal record of an integer and a character string matches a C++ structure of the same constructs, as in this example:
The Pascal procedure, StruChr.p. It is safer for the Pascal procedure to explicitly provide the null byte and include it in the count before the string is passed to C++.
type
TLenStr = record
NBytes: integer;
ChrStr: array [0..24] of char; end;
procedure StruChr (
var v: TLenStr );
begin
v.NBytes := 14;
v.ChrStr := 'St.Petersburg' + chr(0); end;
146 | Pascal 4.0 User’s Guide |