型
基本データ型
整数、実数
整数
octed
オクテットは必ず8ビットである。
byte : 1 [octet]のみ、文字だって数値だし、文字型いらね
integer : CPUが自然に扱える範囲で
| 8bit |
16bit |
32bit |
64bit |
128bit |
| int8 |
int16 |
int32 |
int64 |
int128 |
| byte |
short |
int |
long |
long long |
| byte |
byte2 |
byte4 |
byte8 |
byte16 |
| octet |
octet2 |
octet4 |
octet8 |
octet16 |
| oct |
oct2 |
oct4 |
oct8 |
oct16 |
正数
| 8bit |
16bit |
32bit |
64bit |
128bit |
| ubyte |
ushort |
uint |
ulong |
ulong long |
| uint8 |
uint16 |
uint32 |
uint64 |
uint128 |
| u8 |
u16 |
u32 |
u64 |
u128 |
| ubyte |
ubyte2 |
ubyte4 |
ubyte8 |
ubyte32 |
| uoctet |
uoctet2 |
uoctet4 |
uoctet8 |
uoctet16 |
| uoct |
uoct2 |
uoct4 |
uoct8 |
uoct16 |
実数
floating : 浮動小数点数、IEEEのでもなんでもかまわん
fixed : 固定小数点数、誰得
浮動小数点型
| 1byte |
2byte |
4byte |
8byte |
16byte |
| |
|
float |
double |
|
| |
|
shotr real |
real |
|
虚数
complex
複合データ型
配列、多次元配列、構造体(のようなもの)、列挙、参照、メモリ参照(つまりポインタ)
配列
type[n] array
多次元配列
type[n,m,...] array
構造体、列挙
Cのがいいよ
struct
参照
関数の引数にのみ使える、いわゆる本当のcall by referenceを実現するため
また、メモリ参照を増やさないため
alias unsigned integer uint_t;
ret-type func(ref type[,] array, uint_t row, uint_t column);または
ret-type func(type[,] &array, uint_t row, uint_t column);
メモリ参照
type@ memref
integer@ memref = new integer[n];
integer int, @ memref_int = ∫
@memref_int = 128;
integer[n] array, [n,m] marray
memcpy(&marray[x,0], array, n);
&marray[x,0] != @(marray+x)+0, &array[0] == array
メモリをうまく抽象化できればいいんだけど
文字列
文字列型は動的メモリ管理と直結だから
Cには入ってないんよね
実行系が必須だと困る用途もあるし
結局型のサイズって重要だから
stdint風でいんじゃない?
最終更新:2010年04月18日 23:53