在計算機科學中,複合類型是一種數據類型,它可以原始類型和其它的複合類型所構成。構成一個複合類型的動作,又稱作組合。
基本介紹
- 中文名:複合類型
- 外文名:Composite data type
- 學科:計算機科學
C/C++
struct Account { int account_number; char *first_name; char *last_name; float balance; };typedef struct Account_ { int account_number; char *first_name; char *last_name; float balance; } Account;struct Vector { float x; float y; float z; };struct Color { int red; int green; int blue; };原始子類型檢查
struct ifoo_old_stub { long x, y; }; struct ifoo_version_42 { long x, y, z; char *name; long a, b, c; };void operate_on_ifoo(struct ifoo_old_stub *); struct ifoo_version_42 s;
