_____STRUCT_____ struct AccountHolder { char name[50]; double usd; double idr; double eur; }; int main() { struct AccountHolder ac[20]; return 0; } _____UNION_____ #include <stdio.h> union test { int x, y; }; int main() { union test t; // t.y juga jadi sama t.x = 2; printf("x = 2:\n x new = %d, y new = %d\n\n", t.x, t.y); return 0; } _____ENUM_____ #include<stdio.h> enum kegiatan{bangun, siapsiap, kerja, pulang, tidur}; int main() { enum sehari kegiatan; sehari = bangun; printf("%d",sehari); return 0; } _____BITFIELD_____ #include <stdio.h> struct date { unsigned int d : 5; unsigned int m : 4; unsigned int y...
Postingan
Menampilkan postingan dari November, 2020