Presentation is loading. Please wait.

Presentation is loading. Please wait.

Union, bitfield, typedef, enum union nama_u{ ------ }; union nama_u{ ------ struct nama_s byte; ------ }; enum{ }; Tipedef var BYTE.

Similar presentations


Presentation on theme: "Union, bitfield, typedef, enum union nama_u{ ------ }; union nama_u{ ------ struct nama_s byte; ------ }; enum{ }; Tipedef var BYTE."— Presentation transcript:

1 union, bitfield, typedef, enum union nama_u{ }; union nama_u{ struct nama_s byte; }; enum{ }; Tipedef var BYTE

2 Contoh 1 #include void main() { union { unsigned int di; unsigned char dc[2]; }bil_x; bil_x. di=321; cout<

3 contoh2 #include void main() { Struct info_byte { unsigned bit0 :1; unsigned bit1 :1; unsigned bit2 :1; unsigned bit3 :1; unsigned bit4 :1; unsigned bit5 :1; unsigned bit6 :1; unsigned bit7 :1; }; union { unsigned char karakter; struct info_byte byte; }ascii; ascii.karakter = ‘A’; cout<

4 #include void main() { enum manusia { pria, wanita}; enum manusia jenis_k; jenis_k=pria; cout<

5 #include typedef unsigned char BYTE; BYTE beri_nilai(void); void main() { BYTE kode; Kode=beri_nilai(); cout<<“Kode =“<


Download ppt "Union, bitfield, typedef, enum union nama_u{ ------ }; union nama_u{ ------ struct nama_s byte; ------ }; enum{ }; Tipedef var BYTE."

Similar presentations


Ads by Google