Strings of characters – HP SunSoft Pascal 4.0 User Manual

Page 166

Advertising
background image

142

Pascal 4.0 User’s Guide

7

Strings of Characters

The C++ counterpart to the Pascal alfa and string types are arrays. The C++
counterpart to the Pascal varying type is a structure.

Here is an example:

The Pascal procedure,

StrRef.p

type

TVarStr = varying [25] of char;

procedure StrRef (

var a: alfa;

var s: string;

var v: TVarStr

);

begin

a := 'abcdefghi' + chr(0);

s := 'abcdefghijklmnopqrstuvwxyz' + chr(0);

v := 'varstr' + chr(0);

end;

Advertising