Next: , Previous: Operation Types, Up: Common features


3.26 Type Conversion

Availability: ncap2, ncbo, ncea, ncra, ncwa
Short options: None
Type conversion (often called promotion or demotion) refers to the casting of one fundamental data type to another, e.g., converting NC_SHORT (two bytes) to NC_DOUBLE (eight bytes). Type conversion is automatic when the language carries out this promotion according to an internal set of rules without explicit user intervention. In contrast, manual type conversion refers to explicit user commands to change the type of a variable or attribute. Most type conversion happens automatically, yet there are situations in which manual type conversion is advantageous.