联合体
在计算机科学中,联合体(英语:union)又名共用体,是一种具有多个类型或格式的值,或者把它定义为一种由具有这样的值的变量形成的数据结构。一些编程语言可以支持被称为“联合体”的特殊的数据类型,来表示上述的变量。换句话说,一个联合体的定义(defenition)会指定一些允许的可以存储在实例内的原始数据类型(例如整型,浮点)。和记录(record)(或结构,structure)那些可以被定义去包含一个浮点数或整型不同的是,在一个联合体任何时候只有一个值。
在C语言中,一个典型的例子如下:
| 单词 | Union type |
| 释义 |
Union type
中文百科
联合体在计算机科学中,联合体(英语:union)又名共用体,是一种具有多个类型或格式的值,或者把它定义为一种由具有这样的值的变量形成的数据结构。一些编程语言可以支持被称为“联合体”的特殊的数据类型,来表示上述的变量。换句话说,一个联合体的定义(defenition)会指定一些允许的可以存储在实例内的原始数据类型(例如整型,浮点)。和记录(record)(或结构,structure)那些可以被定义去包含一个浮点数或整型不同的是,在一个联合体任何时候只有一个值。 在C语言中,一个典型的例子如下:
英语百科
Union type 联合体In computer science, a union is a value that may have any of several representations or formats; or it is a data structure that consists of a variable that may hold such a value. Some programming languages support special data types, called union types, to describe such values and variables. In other words, a union type definition will specify which of a number of permitted primitive types may be stored in its instances, e.g., "float or long integer". Contrast with a record (or structure), which could be defined to contain a float and an integer; in a union, there is only one value at any given time. |
| 随便看 |
|
英汉网英语在线翻译词典收录了3779314条英语词汇在线翻译词条,基本涵盖了全部常用英语词汇的中英文双语翻译及用法,是英语学习的有利工具。