HP SunSoft Pascal 4.0 Manuel d'utilisateur Page 116

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 333
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 115
92 Pascal 4.0 Users Guide
6
Array Indexes
Pascal array indexes can start at any integer; C array indexes always start at
zero.
Aggregate Types
Aggregate types include arrays, varying arrays, sets, strings, alphas, records,
and variant records.
Pascal aggregate types may require alignment and layout adjustment to match
C unions, structures, and arrays. Pascal aggregate types can be any of the
following: arrays, varying arrays, sets, strings, alphas, records, or variant
records.
However, you can use the -calign option to eliminate some of these
differences. With -calign, the following assumptions are made:
Pascal records have the same data layout as C structures.
Arrays have the same data layout in both languages. However, if you use
the -xl option in addition to -calign, boolean arrays with an odd
number of elements are different.
Pascal variants are the same as C unions.
Incompatibilities
This section describes the incompatibilities between C and Pascal types.
Enumerated Types
C enumerated types are incompatible with Pascal enumerated types. Pascal
enumerated types are represented internally by sequences of integral values
starting with 0. Storage is allocated for a variable of an enumerated type as if
the type was a subrange of integer. For example, an enumerated type of fewer
than 128 elements is treated as 0..127, which, according to the rules above, is
equivalent to a char in C.
C enumerated types are allocated a full word and can take on arbitrary integer
values.
Vue de la page 115
1 2 ... 111 112 113 114 115 116 117 118 119 120 121 ... 332 333

Commentaires sur ces manuels

Pas de commentaire