2004年08月20日
#includetypedef struct fugafuga_st { int x; int y; }ZZZ; typedef struct { char *popo; int *inin; } F; int main(int argc, char *argv[]) { char hoge[13]; /* sizeof演算子はバイト数を求める時につかう。*/ printf("%d\n", sizeof(char)); printf("%d\n", sizeof(hoge)); /* 構造体も可能 */ printf("%d\n", sizeof(struct fugafuga_st)); printf("%d\n", sizeof(ZZZ)); printf("%d\n", sizeof(F)); printf("%d\n", sizeof(char *)); printf("%d\n", sizeof(int *)); printf("%d\n", sizeof(long long *)); printf("%d\n", sizeof(double *)); return 0; }