:TI-BASIS: Elementare DatentypenTYPE name = (wert_1, ..., wert_n);
C: Unions; Delphi: Sets
Oft ist es notwendig, Daten eines Typs in einen anderen Datentyp umzuwandeln, zu konvertieren. Z.B ein int in ein float.
Folgende Tabelle zeigt die Möglichkeiten auf:
| Typ | konvertiert nach | |||||||
|---|---|---|---|---|---|---|---|---|
| boolean | byte | short | int | long | float | double | char | |
| boolean | - | - | - | - | - | - | - | |
| byte | - | x | x | x | x | x | + | |
| short | - | + | x | x | x | x | + | |
| int | - | + | + | x | x | x | + | |
| long | - | + | + | + | x | x | + | |
| float | - | + | + | + | + | x | + | |
| double | - | + | + | + | + | + | + | |
| char | - | + | + | x | x | x | x | |
Beispiele...